From fba16d1a2ef06769e4eac22fb05c78e6aa06fbad Mon Sep 17 00:00:00 2001 From: Yuta Katayama <8683947+yutkat@users.noreply.github.com> Date: Thu, 25 May 2023 07:55:38 +0900 Subject: [PATCH] Fix CI's trigger --- .github/workflows/count-account.yml | 3 --- .github/workflows/trigger_new_rss.yml | 15 +++++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/count-account.yml b/.github/workflows/count-account.yml index 1f2e02d..2b76da7 100644 --- a/.github/workflows/count-account.yml +++ b/.github/workflows/count-account.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main jobs: github: diff --git a/.github/workflows/trigger_new_rss.yml b/.github/workflows/trigger_new_rss.yml index 7c84eb2..f55588d 100644 --- a/.github/workflows/trigger_new_rss.yml +++ b/.github/workflows/trigger_new_rss.yml @@ -4,25 +4,24 @@ on: push: branches: - main - pull_request: - branches: - - main jobs: github: runs-on: ubuntu-latest container: ubuntu:latest steps: - - uses: actions/checkout@v3 - run: | apt update apt-get install -y git curl + - run: git config --global --add safe.directory $(realpath .) + - uses: actions/checkout@v3 + - name: latest commit message + run: | + echo LATEST_MESSAGE=$(git log --no-merges --oneline -1 --pretty=%f) >> $GITHUB_ENV - name: check commit message - id: check_message - run: exit $(test $(git log --no-merges --oneline -1 --pretty=%f) = "Add") - continue-on-error: true + run: echo RESULT=$(test "$LATEST_MESSAGE" = "Add") >> $GITHUB_ENV - run: | curl -X POST -H "Authorization: token $GH_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/yutkat/new-neovim-plugin-with-category-rss/dispatches -d '{"event_type":"trigger-new-repo"}' env: GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - if: steps.check_message.outcome == 'success' + if: env.LATEST_MESSAGE == 'Add'