Skip to content

Commit

Permalink
Merge pull request #35 from route06/introduce-actionlint-workflow
Browse files Browse the repository at this point in the history
Introduce actionlint workflow
  • Loading branch information
masutaka authored Jun 17, 2024
2 parents 2beb9fa + 26c5a95 commit 4d96af9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/gh_discussion_comment_to_slack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,21 @@ jobs:
# - 一度変数に入れることで、$や`をエスケープしている
# - printfしないといい感じに"\n"が変換されない
# - ref: https://times.hrbrain.co.jp/entry/2021/11/16/github-discussions-noti
- run: |
- name: Post to Slack
env:
COMMENT_BODY: ${{ github.event.comment.body }}
DISCUSSION_TITLE: ${{ toJSON(github.event.discussion.title) }}
run: |
set -o pipefail
body=$(
cat <<"EOF"
${{ github.event.comment.body }}
$COMMENT_BODY
EOF
)
printf -v markdown_message_escaped %b "$body"
jq -n \
--arg pretext "New discussion comment by <${{ github.event.comment.user.html_url }}|${{ github.event.comment.user.login }}>" \
--arg title "*<${{ github.event.comment.html_url }}|Comment on #${{ toJSON(github.event.discussion.number) }} "${{ toJSON(github.event.discussion.title) }}">*" \
--arg title "*<${{ github.event.comment.html_url }}|Comment on #${{ toJSON(github.event.discussion.number) }} \"$DISCUSSION_TITLE\">*" \
--arg text "$markdown_message_escaped" '
{
"attachments": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/my_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Get major version
run: echo "MAJOR_VERSION=$(echo ${{ needs.tagpr.outputs.tagpr-tag }} | cut -d '.' -f 1)" >> $GITHUB_ENV
run: echo "MAJOR_VERSION=$(echo ${{ needs.tagpr.outputs.tagpr-tag }} | cut -d '.' -f 1)" >> "$GITHUB_ENV"
- name: Tag new target
run: git tag -f ${{ env.MAJOR_VERSION }} ${{ needs.tagpr.outputs.tagpr-tag }}
- name: Push new tag
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/my_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
push:
branches:
- main
pull_request:

jobs:
actionlint:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
checks: write
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Run actionlint with reviewdog
uses: reviewdog/action-actionlint@fd627997c9688c2f39e13917aed23873c031b834 # v1.48.0
with:
fail_on_error: true
filter_mode: nofilter
level: error
reporter: github-pr-review
4 changes: 3 additions & 1 deletion .github/workflows/notify_slack_on_ci_failed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:

steps:
- name: Set COMMIT_MESSAGE
run: echo "COMMIT_MESSAGE=${{ github.event.head_commit.message }}" | tr '\n' ' ' >> $GITHUB_ENV
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" | tr '\n' ' ' >> "$GITHUB_ENV"
- name: Notify to slack
uses: tokorom/action-slack-incoming-webhook@main
env:
Expand Down

0 comments on commit 4d96af9

Please sign in to comment.