Compare commits
3 Commits
0.38
...
fix/gitops
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d7dbfa624 | |||
| c00111cff1 | |||
| d263d8a534 |
@@ -39,10 +39,10 @@ jobs:
|
||||
GITEA_TOKEN: ${{ secrets.GITOPS_TOKEN }}
|
||||
|
||||
steps:
|
||||
- name: Install git, curl, ca-certificates
|
||||
- name: Install git, curl, ca-certificates, jq
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y --no-install-recommends git curl ca-certificates
|
||||
apt-get install -y --no-install-recommends git curl ca-certificates jq
|
||||
|
||||
- name: Install tea
|
||||
run: |
|
||||
@@ -62,12 +62,17 @@ jobs:
|
||||
id: resolve
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
GIT_TAG="${{ inputs.tag }}"
|
||||
IMAGE="gitea.home.hrajfrisbee.cz/${{ github.repository }}:${{ inputs.tag }}-go"
|
||||
else
|
||||
# workflow_run: use the ref name of the triggering workflow (the pushed git tag).
|
||||
GIT_TAG="${{ github.event.workflow_run.head_branch }}"
|
||||
# workflow_run: head_branch is not populated for tag pushes in Gitea Actions.
|
||||
# Look up the tag name that points to the triggering commit SHA via the API.
|
||||
SHA="${{ github.event.workflow_run.head_sha }}"
|
||||
GIT_TAG=$(curl -fsSL \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
"https://gitea.home.hrajfrisbee.cz/api/v1/repos/${{ github.repository }}/tags?limit=50" \
|
||||
| jq -r --arg sha "$SHA" '.[] | select(.commit.sha == $sha) | .name')
|
||||
IMAGE="gitea.home.hrajfrisbee.cz/${{ github.repository }}:${GIT_TAG}-go"
|
||||
fi
|
||||
IMAGE="gitea.home.hrajfrisbee.cz/${{ github.repository }}:${GIT_TAG}-go"
|
||||
echo "image=${IMAGE}" >> "$GITHUB_OUTPUT"
|
||||
echo "Resolved image: ${IMAGE}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user