-
Notifications
You must be signed in to change notification settings - Fork 0
chore(release): 1.0.0 #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,112 @@ | |||||||||||||||||||||||||||||
| name: Version Bump and Publish Create Auco | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||
| pull_request: | |||||||||||||||||||||||||||||
| types: [closed] | |||||||||||||||||||||||||||||
| branches: [main] | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||
| check_commit: | |||||||||||||||||||||||||||||
| if: github.event.pull_request.merged == true | |||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||
| outputs: | |||||||||||||||||||||||||||||
| SHOULD_RUN: ${{ steps.check_commit.outputs.SHOULD_RUN }} | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout Files | |||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| token: ${{ secrets.ORG_GITHUB_TOKEN }} | |||||||||||||||||||||||||||||
| fetch-depth: 0 # Need full git history for logs | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: check if skip ci | |||||||||||||||||||||||||||||
| id: check_commit | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| COMMIT_MESSAGE=$(git log -1 --pretty=%B) | |||||||||||||||||||||||||||||
| if [[ "$COMMIT_MESSAGE" == *"[skip ci]"* ]]; then | |||||||||||||||||||||||||||||
| echo "SHOULD_RUN=false" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||
| else | |||||||||||||||||||||||||||||
| echo "SHOULD_RUN=true" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| version-bump-create-auco: | |||||||||||||||||||||||||||||
| needs: check_commit | |||||||||||||||||||||||||||||
| if: ${{ needs.check_commit.outputs.SHOULD_RUN != 'false' }} | |||||||||||||||||||||||||||||
| runs-on: ubuntu-22.04 | |||||||||||||||||||||||||||||
| defaults: | |||||||||||||||||||||||||||||
| run: | |||||||||||||||||||||||||||||
| working-directory: packages/create-auco | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout code | |||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| token: ${{ secrets.ORG_GITHUB_TOKEN }} | |||||||||||||||||||||||||||||
| fetch-depth: 0 # Need full git history for version bumping | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Determine version bump type | |||||||||||||||||||||||||||||
| id: version | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| commit_message=$(git log -1 --pretty=%B) | |||||||||||||||||||||||||||||
| if [[ "$commit_message" == *"[major]"* ]]; then | |||||||||||||||||||||||||||||
| echo "type=major" >> "$GITHUB_ENV" | |||||||||||||||||||||||||||||
| elif [[ "$commit_message" == *"[minor]"* ]]; then | |||||||||||||||||||||||||||||
| echo "type=minor" >> "$GITHUB_ENV" | |||||||||||||||||||||||||||||
| elif [[ "$commit_message" == *"[prerelease]"* ]]; then | |||||||||||||||||||||||||||||
| echo "type=prerelease --preid=rc" >> "$GITHUB_ENV" | |||||||||||||||||||||||||||||
| else | |||||||||||||||||||||||||||||
| echo "type=patch" >> "$GITHUB_ENV" | |||||||||||||||||||||||||||||
| fi | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Set up Node.js | |||||||||||||||||||||||||||||
| uses: actions/setup-node@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| node-version: '20' | |||||||||||||||||||||||||||||
| registry-url: 'https://registry.npmjs.org/' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Install dependencies | |||||||||||||||||||||||||||||
| working-directory: . | |||||||||||||||||||||||||||||
| run: npm install | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Bump version and commit (create-auco) | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
| # Ensure we are on main and up to date | |||||||||||||||||||||||||||||
| git reset --hard HEAD | |||||||||||||||||||||||||||||
| git pull origin main --no-rebase --strategy=ort --no-edit | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| # Configure git user | |||||||||||||||||||||||||||||
| git config --global user.name 'github-actions[bot]' | |||||||||||||||||||||||||||||
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| # Bump version for create-auco package | |||||||||||||||||||||||||||||
| new_version=$(npm version ${{ env.type }} -m "chore(release:create-auco): %s [skip ci]") | |||||||||||||||||||||||||||||
| echo "NEW_VERSION=${new_version}" >> "$GITHUB_ENV" | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| # Push the version bump commit and tag | |||||||||||||||||||||||||||||
| git push origin main --follow-tags | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Build create-auco | |||||||||||||||||||||||||||||
| run: npm run build | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Publish create-auco to NPM | |||||||||||||||||||||||||||||
| run: npm publish | |||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Notify Slack on Success | |||||||||||||||||||||||||||||
| if: success() | |||||||||||||||||||||||||||||
| uses: slackapi/slack-github-action@v1.26.0 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | |||||||||||||||||||||||||||||
| slack-message: '✅ Version bump & publish successful for create-auco: ${{ env.NEW_VERSION }}' | |||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Notify Slack on Failure | |||||||||||||||||||||||||||||
| if: failure() | |||||||||||||||||||||||||||||
| uses: slackapi/slack-github-action@v1.26.0 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | |||||||||||||||||||||||||||||
| slack-message: '❌ Version bump or publish failed for create-auco on main: ${{ github.ref_name }}' | |||||||||||||||||||||||||||||
| env: | |||||||||||||||||||||||||||||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |||||||||||||||||||||||||||||
|
Comment on lines
+32
to
+110
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 3 months ago In general, the fix is to add an explicit The best fix without changing functionality is to add a root-level Concretely, in permissions:
contents: readbetween the existing line 1 (
Suggested changeset
1
.github/workflows/release-create-auco.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| node_modules/ | ||
| dist | ||
| dist/ | ||
| **/dist/ | ||
| .env | ||
| *.log | ||
| *.db | ||
| *.db | ||
| *.tsbuildinfo | ||
| **/*.tsbuildinfo |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 3 months ago
In general, the fix is to explicitly declare a
permissions:block in the workflow (either at the root or per job) that grants only the scopes required. This prevents the workflow from inheriting overly broad default token permissions and documents exactly what the workflow needs.For this specific workflow, the
version-bump-create-aucojob pushes commits and tags to themainbranch using git, which requires repository contents write access. Even though it usessecrets.ORG_GITHUB_TOKEN, it is still best practice to constrain theGITHUB_TOKENas well. Thecheck_commitjob only reads commit messages and does not need write access, so read-only is sufficient there. The simplest, least-disruptive change is to add a root-levelpermissions:block applying to all jobs, grantingcontents: write(so any job that might need to write can do so) and defaulting other scopes tonone. This avoids any behavior change beyond what is already implicitly allowed by the current defaults, while documenting and constraining the scope.Concretely, edit
.github/workflows/release-create-auco.yamland insert apermissions:section just after thename:declaration and before theon:block:No additional methods, imports, or external definitions are needed; this is purely a YAML workflow configuration change.