File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,10 @@ inputs:
8181 description : " Bats-file: clean temp files"
8282 required : false
8383 default : true
84+ github-token :
85+ description : " GitHub token to use to download the releases"
86+ required : false
87+ default : ${{ github.token }}
8488outputs :
8589 bats-installed :
8690 description : " True/False if bats has been installed"
@@ -138,21 +142,23 @@ runs:
138142
139143 # From https://github.com/fluxcd/flux2/blob/44d69d6fc0c353e79c1bad021a4aca135033bce8/action/action.yml#L35
140144 if [[ -z "$VERSION" ]] || [[ "$VERSION" = "latest" ]]; then
141- VERSION=$(curl -fsSL --retry 4 --retry-connrefused -H "Authorization: token ${{ github.token }} " https://api.github.com/repos/bats-core/bats-core/releases/latest | grep tag_name | cut -d '"' -f 4)
145+ VERSION=$(curl -fsSL --retry 4 --retry-connrefused -H "Authorization: token $GITHUB_TOKEN " https://api.github.com/repos/bats-core/bats-core/releases/latest | grep tag_name | cut -d '"' -f 4)
142146 fi
143147 [[ $VERSION == v* ]] && VERSION="${VERSION:1}"
144148
145149 mkdir -p ${TEMPDIR}
146150 mkdir -p ${DESTDIR}
147151
148- curl -sL --retry 4 --retry-connrefused -H "Authorization: token ${{ github.token }} " ${URL}/archive/refs/tags/v${VERSION}.tar.gz | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
152+ curl -sL --retry 4 --retry-connrefused -H "Authorization: token $GITHUB_TOKEN " ${URL}/archive/refs/tags/v${VERSION}.tar.gz | tar xz -C ${TEMPDIR} --strip-components 1 && cd ${TEMPDIR}
149153
150154 ./install.sh ${DESTDIR}
151155 echo "Bats v${VERSION} installed in ${DESTDIR}"
152156 echo "${DESTDIR}/bin" >> "$GITHUB_PATH"
153157 echo "bats-installed=true" >> $GITHUB_OUTPUT
154158
155159 rm -rf ${TEMPDIR} || exit 0
160+ env :
161+ GITHUB_TOKEN : ${{ inputs.github-token }}
156162
157163 - name : Set paths and commands for libraries
158164 shell : bash
You can’t perform that action at this time.
0 commit comments