Skip to content

Commit

Permalink
CI: release drafter GitHub Action needs temporary Git tag (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Jul 29, 2023
1 parent 40d04ca commit 0ecc4e0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,21 @@ jobs:
uses: EndBug/version-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Note: can't use `diff-search: true` because there isn't a way to provide ${{ env.ref }},
# the action expects ${{ event.commits || event.pull_request._links.commits.href }}
# which won't exist on `workflow_dispatch`
# NOTE: `diff-search:true` is preferred so that only the exact commit that bumps the
# version triggers this workflow, but `workflow_dispatch` doesn't carry commit or
# commit ref info that's needed for it.
diff-search: ${{ github.event_name == 'workflow_dispatch' && false || true }}
static-checking: ${{ github.event_name == 'workflow_dispatch' && 'localIsNew' || '' }}
file-url: https://unpkg.com/igir/package.json
static-checking: localIsNew

# Generate the release's markdown template
- if: steps.check.outputs.changed == 'true'
id: auto-changelog
run: |
# NOTE: auto-changelog operates off of git tags, but the tag won't exist until the
# GitHub release is published.
git tag v${{ steps.check.outputs.version }}
# Generate the markdown
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "MARKDOWN<<$EOF" >> "$GITHUB_OUTPUT"
./scripts/auto-changelog.sh >> "$GITHUB_OUTPUT"
Expand All @@ -77,6 +82,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- if: ${{ steps.release-drafter.outputs.id }}
run: |
echo "# v${{ steps.release-drafter.outputs.id }}" >> "$GITHUB_STEP_SUMMARY"
echo "# v${{ steps.check.outputs.version }} @ ${{ env.ref }}" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "${{ steps.release-drafter.outputs.html_url }}" >> "$GITHUB_STEP_SUMMARY"

0 comments on commit 0ecc4e0

Please sign in to comment.