diff --git a/.github/workflows/wai-trigger-cleanup.yml b/.github/workflows/wai-trigger-cleanup.yml index f970d8e573..eb4695576c 100644 --- a/.github/workflows/wai-trigger-cleanup.yml +++ b/.github/workflows/wai-trigger-cleanup.yml @@ -8,15 +8,18 @@ on: types: - closed +permissions: + contents: read + jobs: cleanup-branch-wai: if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 #v7.0.0 with: cache: npm @@ -36,10 +39,10 @@ jobs: if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 #v7.0.0 with: cache: npm diff --git a/.github/workflows/wai-trigger-deploy.yml b/.github/workflows/wai-trigger-deploy.yml index 5a4a4f2597..5245bd261e 100644 --- a/.github/workflows/wai-trigger-deploy.yml +++ b/.github/workflows/wai-trigger-deploy.yml @@ -10,14 +10,17 @@ on: - "content/**" - "README.md" +permissions: + contents: read + jobs: deploy-wai: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1 - name: Trigger wai-aria-practices update - uses: actions/github-script@v7 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd #v8.0.0 with: github-token: ${{ secrets.W3CGRUNTBOT_TOKEN }} script: | diff --git a/.github/workflows/wai-trigger-pr.yml b/.github/workflows/wai-trigger-pr.yml index 98acc8baac..40f2b79826 100644 --- a/.github/workflows/wai-trigger-pr.yml +++ b/.github/workflows/wai-trigger-pr.yml @@ -1,7 +1,7 @@ name: Trigger PR update for WAI-APG site on: - pull_request_target: + pull_request: branches-ignore: - "dependabot/**" paths: @@ -15,17 +15,18 @@ on: - "!content/landmarks/examples/**" - "!common/**" +permissions: + contents: read + jobs: create-pr-wai: runs-on: ubuntu-latest + # Only run on pull requests within the same repository, and not from forks. + if: github.event.pull_request.head.repo.full_name == github.repository steps: - - uses: actions/checkout@v5 - with: - ref: refs/pull/${{ github.event.pull_request.number }}/head - - name: Trigger wai-aria-practices PR update - uses: actions/github-script@v7 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd #v8.0.0 env: APG_BRANCH: ${{ github.head_ref }} APG_SHA: ${{ github.event.pull_request.head.sha }}