Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(dep): Add step to commit changes if PR has dependencies label #108

Merged
merged 1 commit into from Feb 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -11,12 +11,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- run: |
npm install
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"
SVilgelm marked this conversation as resolved.
Show resolved Hide resolved
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
needs: [ build ]
strategy:
matrix:
os:
Expand All @@ -42,6 +61,7 @@ jobs:
only-new-issues: true

test-go-mod-version:
needs: [ build ]
strategy:
matrix:
os:
Expand Down