mirror of
https://github.com/github/codeql-action.git
synced 2026-04-02 17:52:19 +00:00
Add dry-run input to prepare-mergeback-branch
This commit is contained in:
@@ -16,10 +16,33 @@ inputs:
|
||||
token:
|
||||
description: "The token to use"
|
||||
required: true
|
||||
dry-run:
|
||||
description: "Set to true to skip creating the PR. The branch will still be pushed."
|
||||
default: "false"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Create mergeback branch
|
||||
shell: bash
|
||||
env:
|
||||
VERSION: "${{ inputs.version }}"
|
||||
NEW_BRANCH: "${{ inputs.branch }}"
|
||||
run: |
|
||||
set -exu
|
||||
|
||||
# Update the version number ready for the next release
|
||||
npm version patch --no-git-tag-version
|
||||
|
||||
# Update the changelog, adding a new version heading directly above the most recent existing one
|
||||
awk '!f && /##/{print "'"## [UNRELEASED]\n\nNo user facing changes.\n"'"; f=1}1' CHANGELOG.md > temp && mv temp CHANGELOG.md
|
||||
git add .
|
||||
git commit -m "Update changelog and version after ${VERSION}"
|
||||
|
||||
git push origin "${NEW_BRANCH}"
|
||||
|
||||
- name: Create PR
|
||||
shell: bash
|
||||
if: inputs.dry-run != 'true'
|
||||
env:
|
||||
VERSION: "${{ inputs.version }}"
|
||||
BASE_BRANCH: "${{ inputs.base }}"
|
||||
@@ -42,16 +65,6 @@ runs:
|
||||
EOF
|
||||
)
|
||||
|
||||
# Update the version number ready for the next release
|
||||
npm version patch --no-git-tag-version
|
||||
|
||||
# Update the changelog, adding a new version heading directly above the most recent existing one
|
||||
awk '!f && /##/{print "'"## [UNRELEASED]\n\nNo user facing changes.\n"'"; f=1}1' CHANGELOG.md > temp && mv temp CHANGELOG.md
|
||||
git add .
|
||||
git commit -m "Update changelog and version after ${VERSION}"
|
||||
|
||||
git push origin "${NEW_BRANCH}"
|
||||
|
||||
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft
|
||||
# so that a maintainer can take the PR out of draft, thereby triggering the PR checks.
|
||||
gh pr create \
|
||||
|
||||
1
.github/workflows/rollback-release.yml
vendored
1
.github/workflows/rollback-release.yml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
push:
|
||||
paths:
|
||||
- .github/workflows/rollback-release.yml
|
||||
- .github/actions/prepare-mergeback-branch/**
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
|
||||
Reference in New Issue
Block a user