diff options
| author | ST-DDT <[email protected]> | 2024-07-07 14:47:32 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-07-07 14:47:32 +0200 |
| commit | 1c3df29524429afe93466824808938801b338294 (patch) | |
| tree | ddf72fec653237f584dd2858529e86799287d48b /.github | |
| parent | 392d26e23aca89a737d23ed527ccfafce7ff2c2e (diff) | |
| download | faker-1c3df29524429afe93466824808938801b338294.tar.xz faker-1c3df29524429afe93466824808938801b338294.zip | |
infra(release): draft release (#2990)
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/draft-release.yml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml new file mode 100644 index 00000000..73632e1b --- /dev/null +++ b/.github/workflows/draft-release.yml @@ -0,0 +1,52 @@ +name: Draft Release + +on: + pull_request_target: + types: + - closed + paths: + - 'CHANGELOG.md' + +permissions: + contents: write # to create releases + +jobs: + draft_release: + name: Draft Release + if: > + startsWith(github.event.pull_request.title, 'chore(release):') + && github.event.pull_request.merged + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 # we need the tags and the commit history for the gh release create command + ref: ${{ github.event.pull_request.base.ref }} + + - name: Gather release information + run: | + RELEASE_VERSION=$(jq -r '.version' package.json) + echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV + PREVIOUS_VERSION=$(git describe --tags --abbrev=0) + echo "PREVIOUS_VERSION=$PREVIOUS_VERSION" >> $GITHUB_ENV + if [[ "$RELEASE_VERSION" == *"-"* ]]; then + RELEASE_ARGS="--prerelease" + else + RELEASE_ARGS="--latest" + fi + echo "RELEASE_ARGS=$RELEASE_ARGS" >> $GITHUB_ENV + + - name: Create draft release + run: | + gh release create \ + v$RELEASE_VERSION \ + --draft \ + $RELEASE_ARGS \ + --generate-notes \ + --notes-start-tag $PREVIOUS_VERSION \ + --title v$RELEASE_VERSION + env: + GH_TOKEN: ${{ github.token }} |
