Skip to content

Initial commit

Initial commit #1

Workflow file for this run

concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/prepare
- run: pnpm build
- run: git config user.name "${GITHUB_ACTOR}"
- run: git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
- name: Delete branch protection on main
uses: actions/github-script@v6.4.1
with:
github-token: ${{ secrets.ACCESS_TOKEN }}
script: |
try {
await github.request(
`DELETE /repos/JoshuaKGoldberg/template-typescript-node-package/branches/main/protection`,
);
} catch (error) {
if (!error.message?.includes?.("Branch not protected")) {
throw error;
}
}
- env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
if pnpm run should-semantic-release ; then
pnpm release-it --verbose
fi
- if: always()
name: Recreate branch protection on main
uses: actions/github-script@v6.4.1
with:
github-token: ${{ secrets.ACCESS_TOKEN }}
script: |
github.request(
`PUT /repos/JoshuaKGoldberg/template-typescript-node-package/branches/main/protection`,
{
allow_deletions: false,
allow_force_pushes: true,
allow_fork_pushes: false,
allow_fork_syncing: true,
block_creations: false,
branch: "main",
enforce_admins: false,
owner: "JoshuaKGoldberg",
repo: "template-typescript-node-package",
required_conversation_resolution: true,
required_linear_history: false,
required_pull_request_reviews: null,
required_status_checks: {
checks: [
{ context: "build" },
{ context: "compliance" },
{ context: "lint" },
{ context: "lint_knip" },
{ context: "lint_markdown" },
{ context: "lint_package" },
{ context: "lint_packages" },
{ context: "lint_spelling" },
{ context: "prettier" },
{ context: "test" },
],
strict: false,
},
restrictions: null,
}
);
name: Release
on:
push:
branches:
- main
permissions:
contents: write
id-token: write