Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve website workflow #1386

Open
wants to merge 31 commits into
base: dev
Choose a base branch
from

Conversation

kagankan
Copy link
Sponsor Collaborator

Fixes #1374

What is the purpose of this PR?

  • Fix bug
  • Fix typo
  • Update specs
  • Add new rule
  • Add new parser
  • Improve or refactor rules
  • Add a new core feature
  • Improve or refactor core features
  • Update documents
  • Others

Description

  • Add visual regression test
  • Add lint check
  • Add node_modules caching

Checklist

Fill out the checks for the applicable purpose.

@kagankan kagankan self-assigned this Jan 13, 2024
@kagankan
Copy link
Sponsor Collaborator Author

@YusukeHirao
このPRでwebsiteのビジュアルリグレッションテストを追加したいのですが、画像の保存のための権限がなく失敗しているようです。
https://github.com/markuplint/markuplint/actions/runs/7512820384/job/20453916346?pr=1386

workflowのパーミッションを追加してもらうことは可能でしょうか?
Settings > Actions > General > Workflow permissionsRead and write permissions に変更していただきたいです。

参考:
https://zenn.dev/tatsugon/articles/github-actions-permission-error

@YusukeHirao
Copy link
Member

@kagankan

パーミッション変更しました!

@kagankan kagankan force-pushed the feature/improve-website-workflow branch from fe565e3 to 1c40c78 Compare January 27, 2024 08:45
@kagankan kagankan marked this pull request as ready for review January 27, 2024 23:01
@kagankan kagankan marked this pull request as draft January 27, 2024 23:16
@kagankan kagankan force-pushed the feature/improve-website-workflow branch from 7a9e69d to 8753ce6 Compare January 28, 2024 08:35
@kagankan
Copy link
Sponsor Collaborator Author

@YusukeHirao
パーミッション変更ありがとうございました!

その後、pull_request トリガーだとビジュアルリグレッションテストの結果をコメントするための権限がなく、エラーになることがわかりました。
pull_request_target トリガーで実行させる必要があり、そのように変更しています。
pull_request_target トリガーのワークフローはマージ後にしか実行されないため検証ができていないのですが、マージされてから動作確認しようと思います。

pull_request_target トリガーはSecretsにアクセスできるなどセキュリティ上の問題があるため、ラベルをつけたときのみ実行するようにしています。
https://pankona.github.io/blog/2021/03/29/github-actions-pull-request-target/
https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

ご確認お願いします!

@kagankan kagankan marked this pull request as ready for review January 28, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[website] Add visual regression tests
2 participants