From 2b07b74a567880ab346d26c415e93505683f5a6f Mon Sep 17 00:00:00 2001 From: Oishi Takanori Date: Sat, 24 Feb 2024 00:43:23 +0900 Subject: [PATCH] ci: Fix workflows (#5) --- .github/workflows/publish.yml | 20 ++++++++++++++------ .github/workflows/test.yml | 2 +- .husky/pre-push | 1 + 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 .husky/pre-push diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bbfc94c..0078151 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,9 +6,6 @@ on: - main workflow_dispatch: -permissions: - contents: write - concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false @@ -21,8 +18,19 @@ jobs: steps: - uses: actions/checkout@v4 with: + token: ${{ secrets.GH_PAT_CHECKOUT }} fetch-depth: 0 - - uses: increments/qiita-cli/actions/publish@v1 + - uses: actions/setup-node@v4 with: - qiita-token: ${{ secrets.QIITA_TOKEN }} - root: "." + node-version-file: ".node-version" + cache: "npm" + - run: npm ci + - run: npm run qiita publish --all + env: + QIITA_TOKEN: ${{ secrets.QIITA_TOKEN }} + - run: | + git add ./public/* + if ! git diff --staged --exit-code --quiet; then + git commit -m 'Updated by qiita-cli' + git push --force + fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 002c326..cf07ffd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: Test on: - push - - pull_request + - workflow_dispatch jobs: build: diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100644 index 0000000..3867a0f --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1 @@ +npm run lint