-
Notifications
You must be signed in to change notification settings - Fork 0
feat: create auco cli (SS2-127) #70
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
Changes from all commits
d0578bd
8aaafd2
85289d6
73732cc
cfc8b2c
b7a708d
591908d
25d2e77
bd2ea42
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 4 months ago In general, the fix is to add an explicit The single best fix without changing behavior is to add a workflow-level
permissions:
contents: readright after the
permissions:
contents: writebetween No imports or external libraries are needed; this is purely a YAML configuration change in the workflow file.
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 4 months ago
In general, the fix is to add an explicit
permissionsblock to the workflow (or individual jobs) describing the minimal scopes the workflow needs. This ensures theGITHUB_TOKENis not over‑privileged even if repo/org defaults are broad, and documents the workflow’s needs.For this workflow:
check_commit→ needs onlycontents: read.maininversion-bump-create-auco→ needscontents: write.GITHUB_TOKEN.The simplest, least‑privilege change without altering functionality is:
permissions: contents: readso that all jobs default to read‑only.version-bump-create-aucojob withpermissions: contents: write.Concretely:
.github/workflows/release-create-auco.yaml.permissions:block after theon:section (e.g., after line 6).permissions:block under theversion-bump-create-aucojob definition (after itsruns-online).No additional imports or external dependencies are needed.