Skip to content

Commit f614701

Browse files
authored
Fix release and branch actions (#475)
Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent b17b328 commit f614701

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/branch.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: release-branch
22

33
on:
4+
workflow_dispatch:
45
push:
56
tags:
67
- '*.*.*'
@@ -15,11 +16,16 @@ jobs:
1516

1617
- name: Get the branch version
1718
id: get_branch
18-
run: echo ::set-output name=BRANCH::$(echo ${GITHUB_REF/refs\/tags\//#v} | cut -d '.' -f1-2)
19+
run: |
20+
BRANCH=${GITHUB_REF/refs\/tags\//}
21+
if ${{github.event_name == 'workflow_dispatch'}}; then
22+
BRANCH=$(git describe --abbrev=0 --tags)
23+
fi
24+
echo ::set-output name=BRANCH::$(echo ${BRANCH} | cut -d '.' -f1-2 | tr -d 'v')
1925
2026
- name: Create a github branch
2127
uses: peterjgrainger/action-create-branch@v2.0.1
2228
env:
23-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_EXTRA }}
29+
GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GH_TOKEN }}
2430
with:
2531
branch: ${{ steps.get_branch.outputs.BRANCH }}

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: goreleaser
22

33
on:
4+
workflow_dispatch:
45
push:
56
tags:
67
- '*.*.*'
@@ -12,6 +13,8 @@ jobs:
1213
steps:
1314
- name: Checkout
1415
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
1518

1619
- name: Set up Go
1720
uses: actions/setup-go@v1
@@ -34,10 +37,17 @@ jobs:
3437

3538
- name: Update AWS cli
3639
uses: chrislennon/action-aws-cli@v1.1
40+
env:
41+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
3742

3843
- name: Get the version
3944
id: get_version
40-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
45+
run: |
46+
VERSION=${GITHUB_REF/refs\/tags\//}
47+
if ${{github.event_name == 'workflow_dispatch'}}; then
48+
VERSION=$(git describe --abbrev=0 --tags)
49+
fi
50+
echo ::set-output name=VERSION::${VERSION}
4151
4252
- name: Get the builtvar
4353
id: get_built

0 commit comments

Comments
 (0)