ci(dep): Add step to commit changes if PR has dependencies label (#108)
This commit is to perform below steps: - If PR is having dependencies label, update files in dist as well - If PR doesn't have dependencies label, fail the build if there is dirty changes. Closes #55 Signed-off-by: Tam Mach <sayboras@yahoo.com>
This commit is contained in:
parent
cdfc708aeb
commit
03e4befc7a
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@ -11,12 +11,31 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-go@v2
|
|
||||||
- run: |
|
- run: |
|
||||||
npm install
|
npm install
|
||||||
npm run all
|
npm run all
|
||||||
|
|
||||||
|
# Update dist files if there is label dependencies
|
||||||
|
- name: Update dist files
|
||||||
|
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'dependencies')
|
||||||
|
run: |
|
||||||
|
if [[ -z $(git status -s) ]]
|
||||||
|
then
|
||||||
|
echo "No change is required"
|
||||||
|
else
|
||||||
|
echo "Updating dist directory"
|
||||||
|
git config --local user.name "dependabot[bot]"
|
||||||
|
git config --local user.email "49699333+dependabot[bot]@users.noreply.github.com"
|
||||||
|
git add --update
|
||||||
|
git commit --message="Update dist files"
|
||||||
|
git push
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fail the build if there is dirty change
|
||||||
|
- run: git diff --exit-code
|
||||||
|
|
||||||
test: # make sure the action works on a clean machine without building
|
test: # make sure the action works on a clean machine without building
|
||||||
|
needs: [ build ]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
@ -42,6 +61,7 @@ jobs:
|
|||||||
only-new-issues: true
|
only-new-issues: true
|
||||||
|
|
||||||
test-go-mod-version:
|
test-go-mod-version:
|
||||||
|
needs: [ build ]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os:
|
os:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user