diff --git a/.github/release.yml b/.github/release.yml index bd7bf95..18a57a3 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -13,4 +13,4 @@ changelog: - enhancement - title: Other Changes labels: - - "*" + - '*' diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index f99c839..4b23d35 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -9,7 +9,7 @@ jobs: name: npm audit strategy: matrix: - os: [ ubuntu-latest, macos-latest ] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/git-tag.yml b/.github/workflows/git-tag.yml index 481c66e..194f5d3 100644 --- a/.github/workflows/git-tag.yml +++ b/.github/workflows/git-tag.yml @@ -1,4 +1,4 @@ -name: "git tag major version" +name: 'git tag major version' on: release: types: @@ -8,24 +8,24 @@ jobs: tag-major-version: runs-on: ubuntu-latest steps: - - name: check out repository code - uses: actions/checkout@v4 - - name: git config - run: | - git config --global user.name "${GITHUB_ACTOR}" - git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - name: git tag - run: | - git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} - # Extract major version from release tag (e.g., v3.0.0 -> v3) - MAJOR_VERSION=$(echo ${{ github.event.release.tag_name }} | grep -o "^v[0-9]*") - echo "Tagging with major version: ${MAJOR_VERSION}" + - name: check out repository code + uses: actions/checkout@v4 + - name: git config + run: | + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + - name: git tag + run: | + git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} + # Extract major version from release tag (e.g., v3.0.0 -> v3) + MAJOR_VERSION=$(echo ${{ github.event.release.tag_name }} | grep -o "^v[0-9]*") + echo "Tagging with major version: ${MAJOR_VERSION}" - # Delete the major version tag if it exists - git push origin -d ${MAJOR_VERSION} || true + # Delete the major version tag if it exists + git push origin -d ${MAJOR_VERSION} || true - # Create and push the new major version tag - git tag ${MAJOR_VERSION} ${GITHUB_SHA} - git push origin ${MAJOR_VERSION} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Create and push the new major version tag + git tag ${MAJOR_VERSION} ${GITHUB_SHA} + git push origin ${MAJOR_VERSION} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/package-version.yml b/.github/workflows/package-version.yml index a30500f..4f06ecc 100644 --- a/.github/workflows/package-version.yml +++ b/.github/workflows/package-version.yml @@ -1,4 +1,4 @@ -name: "update package version" +name: 'update package version' on: pull_request: types: @@ -9,41 +9,41 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event.label.name == 'release minor' }} steps: - - name: check out repository code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - - name: git config - run: | - git config --global user.name "${GITHUB_ACTOR}" - git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - name: increment minor version - run: | - npm version minor - - name: git push - run: | - git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} - git push origin HEAD:${{ github.head_ref }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: check out repository code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + - name: git config + run: | + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + - name: increment minor version + run: | + npm version minor + - name: git push + run: | + git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} + git push origin HEAD:${{ github.head_ref }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} patch: runs-on: ubuntu-latest if: ${{ github.event.label.name == 'release patch' }} steps: - - name: check out repository code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref }} - - name: git config - run: | - git config --global user.name "${GITHUB_ACTOR}" - git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - name: increment patch version - run: | - npm version patch - - name: git push - run: | - git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} - git push origin HEAD:${{ github.head_ref }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: check out repository code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + - name: git config + run: | + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + - name: increment patch version + run: | + npm version patch + - name: git push + run: | + git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} + git push origin HEAD:${{ github.head_ref }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 028f4b4..c350abd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: "build-test" +name: 'build-test' on: # rebuild any PRs and main branch changes pull_request: push: @@ -10,20 +10,20 @@ jobs: strategy: matrix: node: [20] - os: [ ubuntu-latest, macos-latest ] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - name: Install dependencies and run tests - run: | - npm ci - npm run test:coverage - - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Install dependencies and run tests + run: | + npm ci + npm run test:coverage + - uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} build-on-windows: strategy: @@ -31,44 +31,44 @@ jobs: node: [20] runs-on: windows-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - name: Install dependencies and run tests - run: | - npm ci - npm run test + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Install dependencies and run tests + run: | + npm ci + npm run test test: # make sure the action works on a clean machine without building strategy: matrix: node: [20] - os: [ ubuntu-latest, macos-latest ] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - name: Run npm audit action - uses: ./ - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - issue_title: npm audit run by test job - create_issues: false - production_flag: true - - name: Run npm audit action in testdata workdir - uses: ./ - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - working_directory: __tests__/testdata/workdir/ - create_issues: false - production_flag: true + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Run npm audit action + uses: ./ + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + issue_title: npm audit run by test job + create_issues: false + production_flag: true + - name: Run npm audit action in testdata workdir + uses: ./ + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + working_directory: __tests__/testdata/workdir/ + create_issues: false + production_flag: true # test-on-windows: # strategy: