diff --git a/.github/workflows/guard.yml b/.github/workflows/guard.yml index 1ba723f..ba56f9b 100644 --- a/.github/workflows/guard.yml +++ b/.github/workflows/guard.yml @@ -16,12 +16,12 @@ steps: - name: Preamble run: | - echo "🎉 A $EVENT triggered a ${{ runner.os }} job." - echo "🔎 The branch is $BRANCH in $REPO." + echo "🎉 A ${{ github.event_name }} triggered a ${{ runner.os }} job." + echo "🔎 The branch is ${{ github.ref_name }} in ${{ github.repository }}." - name: Check out repository code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Guard the main branch - if: ${{ env.HEAD != 'staging' && env.HEAD != ''}} + if: ${{ github.event_name == 'pull_request' && github.head_ref != 'staging' }} run: | echo "🚫 The main branch is protected." echo "🚫 Pull requests to main must come from staging branch." diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a9ec193..94f792b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -20,7 +20,7 @@ runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: # Full git history is needed to get a proper # list of changed files within `super-linter`