Skip to content

Commit

Permalink
Use env variable for using job output
Browse files Browse the repository at this point in the history
Move `outputs` at beginning of step for readability
  • Loading branch information
grischperl committed Jan 3, 2024
1 parent 7e1ece0 commit 069cef7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
verify-release:
name: Verify image version
runs-on: ubuntu-latest
outputs:
release_version: ${{ steps.release-version.outputs.release_version }}
steps:
- name: Checkout EPP repository
uses: actions/checkout@v4
Expand All @@ -35,16 +37,17 @@ jobs:
- name: Check image tag
env:
RELEASE_VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }}
RELEASE_VERSION: ${{ steps.release-version.outputs.release_version }}
run: ./scripts/check_tag_info.sh $RELEASE_VERSION

outputs:
release_version: ${{ steps.release-version.outputs.release_version }}

create-draft:
name: Create the draft release
needs: verify-release
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ needs.release-version.outputs.release_version }}
outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}
steps:
- name: Checkout EPP repository
uses: actions/checkout@v4
Expand All @@ -54,27 +57,24 @@ jobs:
- name: Create changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/create_changelog.sh ${{ needs.release-version.outputs.release_version }}
run: ./scripts/create_changelog.sh $RELEASE_VERSION

- name: Create the draft release
id: create-draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_ID=$(./scripts/create_draft_release.sh ${{ needs.release-version.outputs.release_version }})
RELEASE_ID=$(./scripts/create_draft_release.sh $RELEASE_VERSION)
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
- name: Add lightweight tag
run: |
git tag ${{ needs.release-version.outputs.release_version }}
git push origin ${{ needs.release-version.outputs.release_version }}
git tag $RELEASE_VERSION
git push origin $RELEASE_VERSION
- name: Verify job status
run: ./scripts/verify_status.sh ${{ github.ref_name }} 600 10 30

outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}

publish-release:
name: Publish release
needs: [verify-release, create-draft]
Expand Down

0 comments on commit 069cef7

Please sign in to comment.