style(yaml): apply yaml linter to workflow files

This commit is contained in:
Naoki Oketani
2025-05-05 11:20:51 +00:00
parent 38278c3f41
commit cf52e91acd
5 changed files with 101 additions and 101 deletions

2
.github/release.yml vendored
View File

@@ -13,4 +13,4 @@ changelog:
- enhancement
- title: Other Changes
labels:
- "*"
- '*'

View File

@@ -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

View File

@@ -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 }}

View File

@@ -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 }}

View File

@@ -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: