Fix the workflow by adding the version resolve step
@@ -48,6 +48,15 @@ jobs:
tar zxvf ghr_v0.13.0_linux_amd64.tar.gz
sudo mv ghr_v0.13.0_linux_amd64/ghr /usr/local/bin
+ - name: Set version env variable
+ run: |
+ # Define the release tag name based on the event type
+ if [[ "${{ github.event_name }}" == "release" ]]; then
+ echo "VERSION=$(cat ${GITHUB_EVENT_PATH} | jq -r '.release.tag_name')" >> $GITHUB_ENV
+ elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ echo "VERSION=${{ inputs.release_tag_name }}" >> $GITHUB_ENV
+ fi
+
- name: Upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -62,15 +71,6 @@ jobs:
application_private_key: ${{ secrets.ACTIONS_ACCESS_PK }}
organization: ${{ env.TARGET_ORG }}
- - name: Set release tag name
- run: |
- # Define the release tag name based on the event type
- if [[ "${{ github.event_name }}" == "release" ]]; then
- echo "RELEASE_TAG_NAME=$(cat ${GITHUB_EVENT_PATH} | jq -r '.release.tag_name')" >> $GITHUB_ENV
- elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
- echo "RELEASE_TAG_NAME=${{ github.event.inputs.release_tag_name }}" >> $GITHUB_ENV
- fi
-
- name: Resolve push to registries
run: |
# Define the push to registries based on the event type
@@ -86,7 +86,7 @@ jobs:
gh auth login --with-token <<< ${{ steps.get_workflow_token.outputs.token }}
# Trigger the workflow run
- jq -n '{"event_type": "arc", "client_payload": {"release_tag_name": "${{ env.RELEASE_TAG_NAME }}", "push_to_registries": "${{ env.PUSH_TO_REGISTRIES }}" }}' \
+ jq -n '{"event_type": "arc", "client_payload": {"release_tag_name": "${{ env.VERSION }}", "push_to_registries": "${{ env.PUSH_TO_REGISTRIES }}" }}' \
| gh api -X POST /repos/actions-runner-controller/releases/dispatches --input -
- name: Job summary
@@ -94,7 +94,7 @@ jobs:
echo "The [publish-arc](https://github.com/actions-runner-controller/releases/blob/main/.github/workflows/publish-arc.yaml) workflow has been triggered!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Parameters:**" >> $GITHUB_STEP_SUMMARY
- echo "- Release tag: ${{ env.RELEASE_TAG_NAME }}" >> $GITHUB_STEP_SUMMARY
+ echo "- Release tag: ${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "- Push to registries: ${{ env.PUSH_TO_REGISTRIES }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status:**" >> $GITHUB_STEP_SUMMARY
