Skip to content

Commit

Permalink
Fix permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
goruha committed Aug 29, 2024
1 parent 6c3fbe3 commit bc81071
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/shared-terraform-chatops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
outputs:
base: ${{ fromJSON(steps.pr.outputs.json).base.sha }}
head_sha: ${{ fromJSON(steps.pr.outputs.json).head.sha }}
head_repo_owner: ${{ fromJSON(steps.pr.outputs.json).head.repo.owner.login }}
head_repo_name: ${{ fromJSON(steps.pr.outputs.json).head.repo.name }}
found: ${{ steps.pr.outputs.found }}
json: ${{ steps.pr.outputs.json }}
number: ${{ steps.pr.outputs.number }}
Expand All @@ -57,8 +59,9 @@ jobs:
- name: "Add reaction"
uses: peter-evans/create-or-update-comment@v4
with:
repository: ${{ needs.pr.outputs.head_repo_owner }}/${{ needs.pr.outputs.head_repo_name }}
comment-id: ${{ github.event.comment.id }}
token: ${{ secrets.github_access_token }}
token: ${{ github.token }}
reactions: '+1'

pending:
Expand All @@ -71,12 +74,12 @@ jobs:
args: >-
-action update_state
-ref "${{ needs.pr.outputs.head_sha }}"
-repo "${{ github.event.repository.name }}"
-owner "${{ needs.pr.outputs.head_repo_owner }}"
-repo "${{ needs.pr.outputs.head_repo_name }}"
-state pending
-context "test/terratest"
-description "Tests started by @${{ github.actor }}"
-url "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
-owner "${{ github.event.repository.owner.login }}"
env:
GITHUB_TOKEN: ${{ github.token }}

Expand All @@ -96,7 +99,7 @@ jobs:
- name: "Checkout code for ChatOps"
uses: actions/checkout@v4
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
repository: ${{ needs.pr.outputs.head_repo_owner }}/${{ needs.pr.outputs.head_repo_name }}
ref: ${{ needs.pr.outputs.head_sha }}

- name: "Update GitHub Status for pending"
Expand All @@ -105,12 +108,12 @@ jobs:
args: >-
-action update_state
-ref "${{ needs.pr.outputs.head_sha }}"
-repo "${{ github.event.repository.name }}"
-owner "${{ needs.pr.outputs.head_repo_owner }}"
-repo "${{ needs.pr.outputs.head_repo_name }}"
-state pending
-context "test/terratest/${{ matrix.platform }}"
-description "Tests started by @${{ github.actor }}"
-url "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
-owner "${{ github.event.repository.owner.login }}"
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down Expand Up @@ -260,12 +263,12 @@ jobs:
args: >-
-action update_state
-ref "${{ needs.pr.outputs.head_sha }}"
-repo "${{ github.event.repository.name }}"
-owner "${{ needs.pr.outputs.head_repo_owner }}"
-repo "${{ needs.pr.outputs.head_repo_name }}"
-state failure
-context "test/terratest/${{ matrix.platform }}"
-description "Tests failed"
-url "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
-owner "${{ github.event.repository.owner.login }}"
env:
GITHUB_TOKEN: ${{ github.token }}

Expand All @@ -275,12 +278,12 @@ jobs:
args: >-
-action update_state
-ref "${{ needs.pr.outputs.head_sha }}"
-repo "${{ github.event.repository.name }}"
-owner "${{ needs.pr.outputs.head_repo_owner }}"
-repo "${{ needs.pr.outputs.head_repo_name }}"
-state success
-context "test/terratest/${{ matrix.platform }}"
-description "Tests passed"
-url "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
-owner "${{ github.event.repository.owner.login }}"
env:
GITHUB_TOKEN: ${{ github.token }}

Expand All @@ -291,12 +294,12 @@ jobs:
args: >-
-action update_state
-ref "${{ needs.pr.outputs.head_sha }}"
-repo "${{ github.event.repository.name }}"
-owner "${{ needs.pr.outputs.head_repo_owner }}"
-repo "${{ needs.pr.outputs.head_repo_name }}"
-state error
-context "test/terratest/${{ matrix.platform }}"
-description "Tests cancelled"
-url "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
-owner "${{ github.event.repository.owner.login }}"
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down Expand Up @@ -327,12 +330,12 @@ jobs:
args: >-
-action update_state
-ref "${{ needs.pr.outputs.head_sha }}"
-repo "${{ github.event.repository.name }}"
-owner "${{ needs.pr.outputs.head_repo_owner }}"
-repo "${{ needs.pr.outputs.head_repo_name }}"
-state ${{ steps.status.outputs.result }}
-context "test/terratest"
-description "Tests started by @${{ github.actor }}"
-url "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
-owner "${{ github.event.repository.owner.login }}"
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit bc81071

Please sign in to comment.