| 1 |
name: Latest Changes |
| 2 |
|
| 3 |
on: |
| 4 |
pull_request_target: # zizmor: ignore[dangerous-triggers] |
| 5 |
branches: |
| 6 |
- master |
| 7 |
types: |
| 8 |
- closed |
| 9 |
workflow_dispatch: |
| 10 |
inputs: |
| 11 |
number: |
| 12 |
description: PR number |
| 13 |
required: true |
| 14 |
debug_enabled: |
| 15 |
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' |
| 16 |
required: false |
| 17 |
default: 'false' |
| 18 |
|
| 19 |
permissions: {} |
| 20 |
|
| 21 |
jobs: |
| 22 |
latest-changes: |
| 23 |
runs-on: ubuntu-latest |
| 24 |
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true |
| 25 |
timeout-minutes: 5 |
| 26 |
steps: |
| 27 |
- name: Dump GitHub context |
| 28 |
env: |
| 29 |
GITHUB_CONTEXT: ${{ toJson(github) }} |
| 30 |
run: echo "$GITHUB_CONTEXT" |
| 31 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 32 |
with: |
| 33 |
ref: ${{ github.event.repository.default_branch }} |
| 34 |
# To allow latest-changes to commit to the main branch |
| 35 |
token: ${{ secrets.FASTAPI_LATEST_CHANGES }} # zizmor: ignore[secrets-outside-env] |
| 36 |
persist-credentials: true # required by tiangolo/latest-changes |
| 37 |
# Allow debugging with tmate |
| 38 |
- name: Setup tmate session |
| 39 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 # v3.24 |
| 40 |
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }} |
| 41 |
with: |
| 42 |
limit-access-to-actor: true |
| 43 |
- uses: tiangolo/latest-changes@8a940392f4c65274539453a5d5a76d9550203ac1 # 0.7.1 |
| 44 |
with: |
| 45 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 46 |
debug_logs: true |