Skip to content

Commit

Permalink
fix: reference the main workflow version (#6)
Browse files Browse the repository at this point in the history
... doesn't work without a version number: 
```
Invalid workflow file: .github/workflows/this_welcome_message.yml#L13
invalid value workflow reference: no version specified
```
  • Loading branch information
kayman-mk committed May 8, 2024
1 parent 38f8dfd commit 3f1ea88
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/default_release_callable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- name: Setup release
run: |
# using same ref as in calling workflow
# using same ref as in calling workflow
git clone https://github.com/Hapag-Lloyd/Workflow-Templates.git .release_clone
git checkout ${{ github.action_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/default_release_dry_run_callable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- name: Setup release
run: |
# using same ref as in calling workflow
# using same ref as in calling workflow
git clone https://github.com/Hapag-Lloyd/Workflow-Templates.git .release_clone
git checkout ${{ github.action_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven_release_callable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Setup release
run: |
# using same ref as in calling workflow
# using same ref as in calling workflow
git clone https://github.com/Hapag-Lloyd/Workflow-Templates.git .release_clone
git checkout ${{ github.action_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven_release_dry_run_callable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Setup release
run: |
# using same ref as in calling workflow
# using same ref as in calling workflow
git clone https://github.com/Hapag-Lloyd/Workflow-Templates.git .release_clone
git checkout ${{ github.action_ref }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/this_linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ on:

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_linter_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_linter_callable.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/this_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ on:

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_pull_request_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_pull_request_callable.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/this_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ on:

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_release_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_release_callable.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/this_release_dry_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ on:

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_release_dry_run_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_release_dry_run_callable.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/this_renovate_auto_approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ on: pull_request_target

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_renovate_auto_approve_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_renovate_auto_approve_callable.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/this_slash_ops_command_help.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ on:

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_slash_ops_command_help_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_slash_ops_command_help_callable.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/this_slash_ops_comment_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ on:

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_slash_ops_comment_dispatch_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_slash_ops_comment_dispatch_callable.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/this_spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ on:

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_spelling_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_spelling_callable.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/this_stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ on:

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_stale_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_stale_callable.yml@main
secrets: inherit
3 changes: 1 addition & 2 deletions .github/workflows/this_welcome_message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ on:

jobs:
default:
# using stable to be able to quickly switch to a working version in case the current stable is broken
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_welcome_message_callable.yml
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/default_welcome_message_callable.yml@main
secrets: inherit
5 changes: 4 additions & 1 deletion setup-workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ do
# remove everything else as we will reference the file in this repository
sed -i '/jobs:/,$d' "$file"

# add a reference to this repository which holds the workflow
commit_sha=$(git rev-parse HEAD)

cat >> "$file" <<-EOF
jobs:
default:
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/$base_name
uses: Hapag-Lloyd/Workflow-Templates/.github/workflows/$base_name@$commit_sha
secrets: inherit
EOF

Expand Down

0 comments on commit 3f1ea88

Please sign in to comment.