33
33
- name : Dump GitHub context
34
34
env :
35
35
GITHUB_CONTEXT : ' ${{ toJson(github) }}'
36
- run : echo "$GITHUB_CONTEXT"
36
+ run : echo "${ GITHUB_CONTEXT} "
37
37
38
38
- uses : actions/checkout@v3
39
39
- uses : actions/setup-node@v3
@@ -47,39 +47,39 @@ jobs:
47
47
id : getVersion
48
48
run : |
49
49
VERSION="v$(jq '.version' -r 'package.json')"
50
- SHORT_SHA="${GITHUB_SHA:0:8 }"
51
- echo "::set-output name=version::$VERSION "
52
- NEW_BRANCH="mergeback/${VERSION}-to-${BASE_BRANCH}-${SHORT_SHA }"
53
- echo "::set-output name=newBranch::$NEW_BRANCH"
50
+ echo "::set-output name=version::${VERSION }"
51
+ short_sha="${GITHUB_SHA:0:8} "
52
+ NEW_BRANCH="mergeback/${VERSION}-to-${BASE_BRANCH}-${short_sha }"
53
+ echo "::set-output name=newBranch::${ NEW_BRANCH} "
54
54
55
55
56
56
- name : Dump branches
57
57
env :
58
58
NEW_BRANCH : " ${{ steps.getVersion.outputs.newBranch }}"
59
59
run : |
60
- echo "BASE_BRANCH $BASE_BRANCH"
61
- echo "HEAD_BRANCH $HEAD_BRANCH"
62
- echo "NEW_BRANCH $NEW_BRANCH"
60
+ echo "BASE_BRANCH ${ BASE_BRANCH} "
61
+ echo "HEAD_BRANCH ${ HEAD_BRANCH} "
62
+ echo "NEW_BRANCH ${ NEW_BRANCH} "
63
63
64
64
- name : Create mergeback branch
65
65
env :
66
66
NEW_BRANCH : " ${{ steps.getVersion.outputs.newBranch }}"
67
67
run : |
68
- git checkout -b "$NEW_BRANCH"
68
+ git checkout -b "${ NEW_BRANCH} "
69
69
70
70
- name : Check for tag
71
71
id : check
72
72
env :
73
73
VERSION : " ${{ steps.getVersion.outputs.version }}"
74
74
run : |
75
75
set +e # don't fail on an errored command
76
- git ls-remote --tags origin | grep "$VERSION"
77
- EXISTS ="$?"
78
- if [ "$EXISTS " -eq 0 ]; then
79
- echo "Tag $TAG exists. Not going to re-release."
76
+ git ls-remote --tags origin | grep "${ VERSION} "
77
+ exists ="$?"
78
+ if [ "${exists} " -eq 0 ]; then
79
+ echo "Tag ${VERSION} exists. Not going to re-release."
80
80
echo "::set-output name=exists::true"
81
81
else
82
- echo "Tag $TAG does not exist yet."
82
+ echo "Tag ${VERSION} does not exist yet."
83
83
fi
84
84
85
85
# we didn't tag the release during the update-release-branch workflow because the
@@ -113,25 +113,25 @@ jobs:
113
113
GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
114
114
run : |
115
115
set -exu
116
- PR_TITLE ="Mergeback $VERSION $ HEAD_BRANCH into $BASE_BRANCH"
117
- PR_BODY ="Updates version and changelog."
116
+ pr_title ="Mergeback ${ VERSION} ${ HEAD_BRANCH} into ${ BASE_BRANCH} "
117
+ pr_body ="Updates version and changelog."
118
118
119
119
# Update the version number ready for the next release
120
120
npm version patch --no-git-tag-version
121
121
122
122
# Update the changelog
123
123
perl -i -pe 's/^/## \[UNRELEASED\]\n\nNo user facing changes.\n\n/ if($.==3)' CHANGELOG.md
124
124
git add .
125
- git commit -m "Update changelog and version after $VERSION"
125
+ git commit -m "Update changelog and version after ${ VERSION} "
126
126
127
- git push origin "$NEW_BRANCH"
127
+ git push origin "${ NEW_BRANCH} "
128
128
129
129
# PR checks won't be triggered on PRs created by Actions. Therefore mark the PR as draft
130
130
# so that a maintainer can take the PR out of draft, thereby triggering the PR checks.
131
131
gh pr create \
132
- --head "$NEW_BRANCH" \
133
- --base "$BASE_BRANCH" \
134
- --title "$PR_TITLE " \
132
+ --head "${ NEW_BRANCH} " \
133
+ --base "${ BASE_BRANCH} " \
134
+ --title "${pr_title} " \
135
135
--label "Update dependencies" \
136
- --body "$PR_BODY " \
136
+ --body "${pr_body} " \
137
137
--draft
0 commit comments