pulumi/.github/workflows/pr-test-codegen-test-on-dis...

53 lines
1.8 KiB
YAML

# SECURITY: This PR run on untrusted branches when a maintainer comments "/run-acceptance-tests".
#
# Changes "permissions" and "secrets" should be narrowly scoped and carefully reviewed.
#
# Reusable workflows, "uses" jobs, *must* specify the main branch.
on:
repository_dispatch:
types: [ run-codegen-command ]
permissions:
contents: read
# Only the 'changelog-comment' job should use this permission.
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.client_payload.pull_request.number }}
cancel-in-progress: true
jobs:
comment-notification:
runs-on: ubuntu-latest
if: github.event_name == 'repository_dispatch'
permissions:
contents: read
pull-requests: write
steps:
- name: Create URL to the run output
id: vars
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "${GITHUB_OUTPUT}"
- name: Update with Result
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.PULUMI_BOT_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
issue-number: ${{ github.event.client_payload.github.payload.issue.number }}
body: |
Please view the results of the Downstream Codegen Tests [Here][1]
[1]: ${{ steps.vars.outputs.run-url }}
ci-downstream-test-dispatch:
name: CI
if: github.event_name == 'repository_dispatch'
uses: pulumi/pulumi/.github/workflows/ci-codegen.yml@master
permissions:
contents: read
with:
ref: refs/pull/${{ github.event.client_payload.pull_request.number }}/merge
pull_request_number: ${{ github.event.client_payload.pull_request.number }}
secrets: inherit