resolve small PR review comments for stylus merge on activate #40
Workflow file for this run
This file contains hidden or 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: Changelog fragments for automated PRs | |
| on: | |
| pull_request: | |
| types: [opened] | |
| jobs: | |
| add-changelog: | |
| # Only run if the PR is opened by dependabot | |
| if: github.actor == 'dependabot[bot]' | |
| runs-on: ubuntu-4 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Create Changelog File | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const dir = 'changelog'; | |
| // Find the next available number | |
| let x = 1; | |
| while (fs.existsSync(path.join(dir, `dependabot-${x}.md`))) { | |
| x++; | |
| } | |
| const filename = path.join(dir, `dependabot-${x}.md`); | |
| const title = context.payload.pull_request.title; | |
| const content = `### Ignored\n- ${title}\n`; | |
| fs.writeFileSync(filename, content); | |
| console.log(`Created ${filename} for PR: ${title}`); | |
| - name: Commit and Push | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: "Add a changelog entry for dependabot update" | |
| file_pattern: 'changelog/dependabot-*.md' |