Skip to content

Commit 75fcae4

Browse files
authored
Fix Release GH Action workflow (#223)
1 parent 8cee526 commit 75fcae4

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ on:
55
types: [published]
66

77
jobs:
8-
bump_alidist:
9-
runs-on: ubuntu-18.04
8+
alidist:
9+
runs-on: ubuntu-latest
1010
steps:
11-
- run: curl -L https://github.com/github/hub/releases/download/v2.12.7/hub-linux-amd64-2.12.7.tgz | tar xz
12-
- run: |
13-
git config --global user.email ${{ secrets.GH_EMAIL }}
14-
git config --global user.name ${{ secrets.GH_USERNAME }}
15-
- run: git clone git://github.com/${{ secrets.ORG }}/alidist
16-
- run: |
17-
cd alidist
18-
CURRENT_VERSION=`cat monitoring.sh | grep "tag:" | awk '{print $2}'`
19-
sed -i "s/${CURRENT_VERSION}/${GITHUB_REF##*/}/g" monitoring.sh
20-
- run: |
21-
cd alidist
22-
git add .
23-
git commit -m "Bump monitoring to ${GITHUB_REF##*/}"
24-
git push "https://${{ secrets.GH_TOKEN }}@github.com/${{ secrets.ORG }}/alidist" HEAD:refs/heads/monitoring-${GITHUB_REF##*/} -f > /dev/null 2>&1
25-
- run: |
26-
cd alidist
27-
GITHUB_TOKEN=${{ secrets.GH_TOKEN }} ../hub-linux-amd64-2.12.7/bin/hub pull-request -h monitoring-${GITHUB_REF##*/} -b master -m "Bump monitoring to ${GITHUB_REF##*/}"
11+
- uses: actions/checkout@v2
12+
with:
13+
repository: 'alisw/alidist'
14+
- name: Change version in recipe
15+
run: |
16+
set +x
17+
CURRENT_VERSION=`cat monitoring.sh | grep "tag:" | awk '{print $2}'`
18+
sed -i "s/${CURRENT_VERSION}/${{ github.event.release.tag_name }}/g" monitoring.sh
19+
- name: Create PR in alidist
20+
uses: peter-evans/create-pull-request@v3
21+
with:
22+
token: ${{ secrets.PAT }}
23+
commit-message: Bump monitoring
24+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
25+
branch: monitoring-${{ github.event.release.tag_name }}
26+
body: Auto-generated PR for the following release ${{ github.event.release.html_url }}
27+
title: Bump monitoring to ${{ github.event.release.tag_name }}

0 commit comments

Comments
 (0)