chore: update to only build #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run build and update PR for dependabot PRs | ||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
defaults: | ||
run: | ||
shell: bash | ||
jobs: | ||
update-dependencies: | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34 #v2.2.0 | ||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1 | ||
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'npm_and_yarn' }} | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Set up Node.js | ||
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'npm_and_yarn' }} | ||
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 #v4.0.4 | ||
with: | ||
node-version-file: package.json | ||
- name: Install dependencies | ||
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'npm_and_yarn' }} | ||
run: npm ci | ||
- name: Run build | ||
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'npm_and_yarn' }} | ||
run: | | ||
npm run build | ||
- name: Commit and push if it changed | ||
run: |- | ||
git config user.name "Anchore Automated" | ||
git config user.email "actions@users.noreply.github.com" | ||
git add -A | ||
timestamp=$(date -u) | ||
git commit --signoff -m "Latest build: ${timestamp}" || exit 0 | ||
git push |