📦 Publish SDKs (#3733) #270
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: Auto lint & commit 🤖 | |
on: | |
push: | |
branches: | |
- main | |
env: | |
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
permissions: | |
contents: write | |
jobs: | |
auto-lint-and-commit: | |
name: Auto lint & commit 🤖 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
token: ${{ secrets.LINT_AND_COMMIT_PAT }} | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: 📥 Monorepo install | |
uses: ./.github/actions/yarn-nm-install | |
with: | |
cache-node-modules: true | |
cache-install-state: true | |
- name: Run prettier | |
run: yarn workspace @builder.io/root lint:fix | |
- name: Run eslint | |
run: yarn workspace @builder.io/sdks lint | |
- name: "Import GPG key" | |
id: import-gpg | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.LINT_AND_COMMIT_GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.LINT_AND_COMMIT_GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
id: auto-commit-action | |
with: | |
commit_message: Apply linting changes | |
commit_author: "${{ steps.import-gpg.outputs.name }} <${{ steps.import-gpg.outputs.email }}>" | |
commit_user_name: ${{ steps.import-gpg.outputs.name }} | |
commit_user_email: ${{ steps.import-gpg.outputs.email }} | |
- name: "Run if changes have been detected" | |
if: steps.auto-commit-action.outputs.changes_detected == 'true' | |
run: echo "Committed linting changes." | |
- name: "Run if no changes have been detected" | |
if: steps.auto-commit-action.outputs.changes_detected == 'false' | |
run: echo "No linting changes to commit." | |