From 0e40de2782b04b4e38556e372600ce69bde596e8 Mon Sep 17 00:00:00 2001 From: FonduemangVI <15520607+FonduemangVI@users.noreply.github.com> Date: Sun, 2 Jun 2024 18:58:22 +1000 Subject: [PATCH] fix(workflows): rollback deploy changes and make contribs run only on master --- .github/workflows/deploy.yml | 10 +++++----- .github/workflows/update_contributors.yml | 11 +++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4407d6cd0f..8d6b8fa1cd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,10 +1,10 @@ name: Build and Deploy Docs on: - workflow_run: - workflows: [Update contributors] - types: - - completed + push: + branches: + - master + pull_request: jobs: build: @@ -44,7 +44,7 @@ jobs: run: mkdocs build deploy: - if: github.event.workflow_run.event == 'push' && contains(fromJson('["master", "main"]'), github.event.workflow_run.head_branch) + if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref) needs: build name: Deploy docs runs-on: ubuntu-latest diff --git a/.github/workflows/update_contributors.yml b/.github/workflows/update_contributors.yml index c249c505c8..098b32e663 100644 --- a/.github/workflows/update_contributors.yml +++ b/.github/workflows/update_contributors.yml @@ -4,21 +4,17 @@ on: push: branches: - master - pull_request: permissions: contents: write jobs: update_contributors: + if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref) runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} # Use the forked repository if available, otherwise the main repository - ref: ${{ github.event.pull_request.head.ref || github.ref_name }} # Use the PR branch name if available, otherwise the branch name - fetch-depth: 0 # Fetch all history for all branches and tags - name: Install Node.js uses: actions/setup-node@v4 @@ -34,9 +30,8 @@ jobs: - name: Commit and push if it's not up to date run: | + git diff git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - git checkout -B ${{ github.event.pull_request.head.ref || github.ref_name }} # Ensure we're on the correct branch - git diff git commit -am "chore(contributors): Update CONTRIBUTORS.md" || exit 0 - git push origin ${{ github.event.pull_request.head.ref || github.ref_name }} + git push