Skip to content

Commit 4d71f5f

Browse files
authored
[chore] Update Github action workflows to fix node version and set-output deprecation warnings (#2431)
* [chore]: Update github action workflows to fix node version and deprecation warnings * fix: typo * fix: missed upgrade
1 parent 4d96683 commit 4d71f5f

File tree

4 files changed

+19
-24
lines changed

4 files changed

+19
-24
lines changed

.github/scripts/publish_preflight_check.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if [[ ! "${RELEASE_VERSION}" =~ ^([0-9]*)\.([0-9]*)\.([0-9]*)$ ]]; then
7070
fi
7171

7272
echo_info "Extracted release version: ${RELEASE_VERSION}"
73-
echo "::set-output name=version::v${RELEASE_VERSION}"
73+
echo "version=v${RELEASE_VERSION}" >> $GITHUB_OUTPUT
7474

7575

7676
echo_info ""
@@ -156,12 +156,13 @@ readonly CHANGELOG=`${CURRENT_DIR}/generate_changelog.sh`
156156
echo "$CHANGELOG"
157157

158158
# Parse and preformat the text to handle multi-line output.
159-
# See https://github.community/t5/GitHub-Actions/set-output-Truncates-Multiline-Strings/td-p/37870
159+
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string
160+
# and https://github.com/github/docs/issues/21529#issue-1418590935
160161
FILTERED_CHANGELOG=`echo "$CHANGELOG" | grep -v "\\[INFO\\]"` || true
161-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//'%'/'%25'}"
162-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\n'/'%0A'}"
163-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\r'/'%0D'}"
164-
echo "::set-output name=changelog::${FILTERED_CHANGELOG}"
162+
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\''/'"'}"
163+
echo "changelog<<CHANGELOGEOF" >> $GITHUB_OUTPUT
164+
echo -e "$FILTERED_CHANGELOG" >> $GITHUB_OUTPUT
165+
echo "CHANGELOGEOF" >> $GITHUB_OUTPUT
165166

166167

167168
echo ""

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
node-version: [14.x, 16.x]
1313

1414
steps:
15-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v4
1616
- name: Set up Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v1
17+
uses: actions/setup-node@v4
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
- name: Install and build

.github/workflows/nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929

3030
steps:
3131
- name: Checkout source for staging
32-
uses: actions/checkout@v2
32+
uses: actions/checkout@v4
3333
with:
3434
ref: ${{ github.event.client_payload.ref || github.ref }}
3535

3636
- name: Set up Node.js
37-
uses: actions/setup-node@v1
37+
uses: actions/setup-node@v4
3838
with:
3939
node-version: 14.x
4040

.github/workflows/release.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
# via the 'ref' client parameter.
4141
steps:
4242
- name: Checkout source for staging
43-
uses: actions/checkout@v2
43+
uses: actions/checkout@v4
4444
with:
4545
ref: ${{ github.event.client_payload.ref || github.ref }}
4646

4747
- name: Set up Node.js
48-
uses: actions/setup-node@v1
48+
uses: actions/setup-node@v4
4949
with:
5050
node-version: 14.x
5151

@@ -104,7 +104,7 @@ jobs:
104104

105105
steps:
106106
- name: Checkout source for publish
107-
uses: actions/checkout@v2
107+
uses: actions/checkout@v4
108108

109109
# Download the artifacts created by the stage_release job.
110110
- name: Download release candidates
@@ -114,27 +114,21 @@ jobs:
114114

115115
# Node.js and NPM are needed to complete the publish.
116116
- name: Set up Node.js
117-
uses: actions/setup-node@v1
117+
uses: actions/setup-node@v4
118118
with:
119119
node-version: 14.x
120120

121121
- name: Publish preflight check
122122
id: preflight
123123
run: ./.github/scripts/publish_preflight_check.sh
124124

125-
# We pull this action from a custom fork of a contributor until
126-
# https://github.com/actions/create-release/pull/32 is merged. Also note that v1 of
127-
# this action does not support the "body" parameter.
125+
# See: https://cli.github.com/manual/gh_release_create
128126
- name: Create release tag
129-
uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
130127
env:
131128
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132-
with:
133-
tag_name: ${{ steps.preflight.outputs.version }}
134-
release_name: Firebase Admin Node.js SDK ${{ steps.preflight.outputs.version }}
135-
body: ${{ steps.preflight.outputs.changelog }}
136-
draft: false
137-
prerelease: false
129+
run: gh release create ${{ steps.preflight.outputs.version }}
130+
--title "Firebase Admin Node.js SDK ${{ steps.preflight.outputs.version }}"
131+
--notes '${{ steps.preflight.outputs.changelog }}'
138132

139133
- name: Publish to NPM
140134
run: ./.github/scripts/publish_package.sh

0 commit comments

Comments
 (0)