Skip to content

Commit d4cc540

Browse files
artursouzacicoyle
authored andcommitted
DaprBot pushing tag or to branch already triggers build. (dapr#1238)
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
1 parent ea8e3f8 commit d4cc540

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

.github/workflows/create-release.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
uses: actions/checkout@v4
3333
with:
3434
fetch-depth: 0
35+
token: ${{ secrets.DAPR_BOT_TOKEN }}
36+
persist-credentials: false
3537
- name: Set up OpenJDK ${{ env.JDK_VER }}
3638
uses: actions/setup-java@v4
3739
with:
@@ -48,25 +50,7 @@ jobs:
4850
git config user.email "daprweb@microsoft.com"
4951
git config user.name "Dapr Bot"
5052
# Update origin with token
51-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
53+
git remote set-url origin https://x-access-token:${{ secrets.DAPR_BOT_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
5254
# Copy first to allow automation to use the latest version and not the release branch's version.
5355
cp -R ./.github/scripts ${RUNNER_TEMP}/
54-
${RUNNER_TEMP}/scripts/create-release.sh ${{ inputs.rel_version }}
55-
trigger:
56-
name: Triggers the Dapr SDK build
57-
runs-on: ubuntu-latest
58-
needs: create-release
59-
steps:
60-
- name: Identify build ref to trigger build and release.
61-
run: |
62-
if [[ "${{ inputs.rel_version }}" == *"SNAPSHOT"* ]]; then
63-
echo "BUILD_GIT_REF=master" >> $GITHUB_ENV
64-
else
65-
echo "BUILD_GIT_REF=v${{ inputs.rel_version }}" >> $GITHUB_ENV
66-
fi
67-
- name: Triggers the build and release.
68-
if: env.BUILD_GIT_REF != 'master'
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
71-
run: |
72-
gh workflow run build.yml --repo ${GITHUB_REPOSITORY} --ref v$(echo '${{ env.BUILD_GIT_REF }}' | sed -r 's/^[vV]?([0-9].+)$/\1/')
56+
${RUNNER_TEMP}/scripts/create-release.sh ${{ inputs.rel_version }}

0 commit comments

Comments
 (0)