mirror of
https://github.com/hectorm/docker-qemu-reactos
synced 2025-01-09 10:36:37 +00:00
Use environment variable instead of context
This commit is contained in:
parent
4b18db3c42
commit
526a0afb0d
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@ -93,17 +93,19 @@ jobs:
|
|||||||
contents: 'write'
|
contents: 'write'
|
||||||
steps:
|
steps:
|
||||||
- name: 'Create release'
|
- name: 'Create release'
|
||||||
|
env:
|
||||||
|
GITHUB_PAT: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
run: |
|
run: |
|
||||||
RELEASE_STATUS="$(curl -fs --proto '=https' --tlsv1.3 --globoff \
|
RELEASE_STATUS="$(curl -fs --proto '=https' --tlsv1.3 --globoff \
|
||||||
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/tags/${GITHUB_REF_NAME:?}" \
|
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/tags/${GITHUB_REF_NAME:?}" \
|
||||||
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
|
--header "Authorization: Bearer ${GITHUB_PAT:?}" \
|
||||||
--header 'Accept: application/vnd.github.v3+json' \
|
--header 'Accept: application/vnd.github.v3+json' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--write-out '%{http_code}' --output /dev/null ||:)"
|
--write-out '%{http_code}' --output /dev/null ||:)"
|
||||||
if [ "${RELEASE_STATUS:?}" = '200' ]; then exit 0; fi
|
if [ "${RELEASE_STATUS:?}" = '200' ]; then exit 0; fi
|
||||||
RELEASE_ID="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \
|
RELEASE_ID="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \
|
||||||
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases" \
|
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases" \
|
||||||
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
|
--header "Authorization: Bearer ${GITHUB_PAT:?}" \
|
||||||
--header 'Accept: application/vnd.github.v3+json' \
|
--header 'Accept: application/vnd.github.v3+json' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--data "$(jq -rn --arg tag "${GITHUB_REF_NAME:?}" '{"name": $tag, "tag_name": $tag, "generate_release_notes": true}')" | jq -r '.id')"
|
--data "$(jq -rn --arg tag "${GITHUB_REF_NAME:?}" '{"name": $tag, "tag_name": $tag, "generate_release_notes": true}')" | jq -r '.id')"
|
||||||
|
8
.github/workflows/rebuild-latest-release.yml
vendored
8
.github/workflows/rebuild-latest-release.yml
vendored
@ -12,21 +12,21 @@ jobs:
|
|||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
permissions:
|
permissions:
|
||||||
contents: 'read'
|
contents: 'read'
|
||||||
env:
|
|
||||||
PERSONAL_GITHUB_TOKEN: '${{ secrets.PERSONAL_GITHUB_TOKEN }}'
|
|
||||||
steps:
|
steps:
|
||||||
- name: 'REST API call'
|
- name: 'REST API call'
|
||||||
|
env:
|
||||||
|
GITHUB_PAT: '${{ secrets.PERSONAL_GITHUB_TOKEN }}'
|
||||||
run: |
|
run: |
|
||||||
RELEASE_TAG="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \
|
RELEASE_TAG="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \
|
||||||
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/latest" \
|
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/latest" \
|
||||||
--header "Authorization: Bearer ${PERSONAL_GITHUB_TOKEN:?}" \
|
--header "Authorization: Bearer ${GITHUB_PAT:?}" \
|
||||||
--header 'Accept: application/vnd.github.v3+json' \
|
--header 'Accept: application/vnd.github.v3+json' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
| jq -rc '.tag_name')"
|
| jq -rc '.tag_name')"
|
||||||
if [ -n "${RELEASE_TAG-}" ] && [ "${RELEASE_TAG:?}" != 'null' ]; then
|
if [ -n "${RELEASE_TAG-}" ] && [ "${RELEASE_TAG:?}" != 'null' ]; then
|
||||||
curl -fsS --proto '=https' --tlsv1.3 --globoff \
|
curl -fsS --proto '=https' --tlsv1.3 --globoff \
|
||||||
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/actions/workflows/main.yml/dispatches" \
|
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/actions/workflows/main.yml/dispatches" \
|
||||||
--header "Authorization: Bearer ${PERSONAL_GITHUB_TOKEN:?}" \
|
--header "Authorization: Bearer ${GITHUB_PAT:?}" \
|
||||||
--header 'Accept: application/vnd.github.v3+json' \
|
--header 'Accept: application/vnd.github.v3+json' \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--data "$(jq -rn --arg tag "${RELEASE_TAG:?}" '{"ref": $tag}')"
|
--data "$(jq -rn --arg tag "${RELEASE_TAG:?}" '{"ref": $tag}')"
|
||||||
|
Loading…
Reference in New Issue
Block a user