chore(main): release 3.0.2 #796
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI" | |
on: # rebuild any PRs and main branch changes | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-package: # make sure build/ci work properly | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: npm | |
- run: npm ci | |
- run: npm run package | |
test-lint: # make sure build/ci work properly | |
permissions: | |
contents: read | |
checks: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: npm | |
- run: npm ci | |
- run: npm run ci | |
- name: Upload test report | |
if: ${{ always() }} | |
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4.3.1 | |
with: | |
report_paths: "**/reports/jest.xml" | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
use-with-dry-run: # make sure the action works on a clean machine without building | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 # Because if `fetch-depth >= 2` is not set, unchanged files will be updated. | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: npm | |
- run: npm ci | |
- run: npm run package | |
- run: "git log -m -1 --name-only --pretty=format: HEAD" | |
- run: "git log -m -1 --name-only HEAD" | |
- run: | | |
cp articles/sampleMarkdown.md articles/test.md | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git add -A | |
git commit -m "test" | |
- uses: ./ | |
env: | |
TZ: Asia/Tokyo | |
with: | |
published: true | |
auto-generate-published-at: next_business_day_10 | |
dry-run: true | |
validate: true | |
commit-sha: . | |
- run: git diff articles/test.md | |
use-with-validate-only: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 # Because if `fetch-depth >= 2` is not set, unchanged files will be updated. | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: npm | |
- run: npm ci | |
- run: npm run package | |
- run: "git log -m -1 --name-only --pretty=format: HEAD" | |
- run: "git log -m -1 --name-only HEAD" | |
- run: | | |
cp ./src/__tests__/invalidMarkdown.md . | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git add -A | |
git commit -m "test" | |
- name: "Execute validate-only. This step must fail. Print 'Error: Invalid metadata: emoji'." | |
uses: ./ | |
id: action | |
with: | |
validate-only: true | |
commit-sha: . | |
continue-on-error: true | |
- if: ${{ steps.action.outcome == 'failure' }} | |
run: echo "Success" | |
- if: ${{ steps.action.outcome == 'success' }} | |
run: | | |
echo "Failure" | |
exit 1 |