Skip to content

Commit 8e1e578

Browse files
committed
chore(woodpecker): add env export
1 parent 92948d5 commit 8e1e578

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

.woodpecker/build.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ steps:
88
commands:
99
- make check
1010
when:
11-
event:
12-
- pull_request
13-
- tag
14-
- push
11+
- event: tag
12+
ref: refs/tags/v*
13+
- event: push
14+
- event: pull_request
1515

1616
- name: publish
1717
image: bash
1818
commands:
1919
- export BOT_GITHUB_TOKEN=$GITHUB_TOKEN
2020
- export PULL_BASE_REF=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)
21+
- export GIT_REPO=${CI_REPO}
22+
- export GIT_TAG=${PULL_BASE_REF}
2123
- make prepare-assets
2224
- make $([ -z $CI_COMMIT_TAG ] && echo latest-release || echo push-release)
2325
environment:
@@ -26,6 +28,6 @@ steps:
2628
secrets:
2729
- github_token
2830
when:
29-
event:
30-
- tag
31-
- push
31+
- event: tag
32+
ref: refs/tags/v*
33+
- event: push

scripts/remove_latest_release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
GIT_REPO=$1
55

66
echo "Getting latest release from $GIT_REPO"
7-
RESP=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/$GIT_REPO/releases/latest")
7+
RESP=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" "https://api.github.com/repos/$GIT_REPO/releases/tags/latest")
88
URLS=$(echo "$RESP" | jq -r .url)
99
if [ "${URLS}" ] && [ -z "${URLS}" ]; then
1010
echo ${RESP}

0 commit comments

Comments
 (0)