Merge pull request #28469 from backstage/rugvip/notes #37
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: Sync code formatting | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
autofix-markdown: | |
name: Autofix Markdown files using Prettier | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
with: | |
egress-policy: audit | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
# Fetch changes to previous commit - required for 'only_changed' in Prettier action | |
fetch-depth: 0 | |
- name: use node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://registry.npmjs.org/ # Needed for auth | |
- name: yarn install | |
uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17 | |
with: | |
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} | |
- name: Run Prettier on ADOPTERS.md | |
uses: creyD/prettier_action@31355f8eef017f8aeba2e0bc09d8502b13dbbad1 # v4.3 | |
with: | |
# Modifies commit only if prettier autofixed the ADOPTERS.md | |
prettier_options: --config docs/prettier.config.js --write ADOPTERS.md | |
only_changed: true | |
commit_message: 'Autofix ADOPTERS.md using Prettier' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |