Skip to content

feat: implement JWT authentication and GitHub Labels #19

feat: implement JWT authentication and GitHub Labels

feat: implement JWT authentication and GitHub Labels #19

name: Dependabot Auto-Update
# Trigger on pull requests from dependabot
on:
pull_request:
paths:
- 'package.json'
- 'package-lock.json'
permissions:
contents: write
pull-requests: write
jobs:
update-dist:
# Only run for dependabot PRs
if: github.actor == 'dependabot[bot]'
name: Update dist/ for Dependabot PR
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v4
with:
# Use the GITHUB_TOKEN to checkout the PR branch
token: ${{ secrets.GITHUB_TOKEN }}
# Fetch the PR branch
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install Dependencies
run: npm ci
- name: Build and Update dist/
run: npm run all
- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain dist/)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.verify-changed-files.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add dist/
git commit -m "Update dist/ directory
Auto-generated by dependabot-auto-update workflow"
git push
- name: Comment on PR
if: steps.verify-changed-files.outputs.changed == 'true'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🤖 **Dependabot Auto-Update**\n\nI\'ve automatically updated the `dist/` directory to reflect the dependency changes in this PR.\n\nThe build artifacts have been regenerated using `npm run all`.'
})