Skip to content

Commit

Permalink
Update event info to note that the workflow was triggered manually if…
Browse files Browse the repository at this point in the history
… the repo/title was not provided. Update description of workflow_dispatch argument to describe what it can be used for when triggering manually. Only run step to build URL to commit that triggered workflow if it was triggered from an external repo
  • Loading branch information
georgemccabe committed Dec 9, 2024
1 parent c37b5d3 commit 861901a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
force_met_image:
description: 'MET DockerHub repo to force run to use, e.g. met:11.1.0 or met-dev:feature_XYZ_name-PR. Leave this blank to determine repo automatically.'
repository:
description: 'Repository that triggered workflow (used by external repo triggering)'
description: 'Repository that triggered workflow if triggered by external repo or title of workflow run if triggered via web interface'
sha:
description: 'Commit hash that triggered the event (used by external repo triggering)'
ref:
Expand All @@ -48,7 +48,7 @@ on:
jobs:

event_info:
name: "Trigger: ${{ github.event_name != 'workflow_dispatch' && github.event_name || github.event.inputs.repository }} ${{ github.event_name != 'workflow_dispatch' && 'event' || github.event.inputs.sha }} ${{ github.event_name != 'workflow_dispatch' && 'local' || github.event.inputs.actor }} "
name: "Trigger: ${{ github.event_name != 'workflow_dispatch' && github.event_name || (github.event.inputs.repository || 'Manual Trigger Testing') }} ${{ github.event_name != 'workflow_dispatch' && 'event' || github.event.inputs.sha }} ${{ github.event_name != 'workflow_dispatch' && 'local' || github.event.inputs.actor }} "
runs-on: ubuntu-latest
steps:
- name: Print GitHub values for reference
Expand All @@ -59,7 +59,7 @@ jobs:
# message is too long
continue-on-error: true
- name: Build URL for commit that triggered workflow
if: github.event_name == 'workflow_dispatch'
if: github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.repository, 'dtcenter/') && github.event.inputs.sha
run: echo https://github.com/${{ github.event.inputs.repository }}/commit/${{ github.event.inputs.sha }}

job_control:
Expand Down

0 comments on commit 861901a

Please sign in to comment.