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

fix: evaluated GitHub actions workflow files #268

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .github/workflows/notify-tsc-members-mention.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ jobs:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
ISSUE_TITLE: ${{ github.event.issue.title }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
mhmohona marked this conversation as resolved.
Show resolved Hide resolved
sendEmail('${{github.event.issue.html_url}}', '${{github.event.issue.title}}');
sendEmail('${{github.event.issue.html_url}}', process.env.ISSUE_TITLE);

pull_request:
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -111,10 +112,12 @@ jobs:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
PR_TITLE: ${{ github.event.pull_request.title }}

with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.pull_request.html_url}}', '${{github.event.pull_request.title}}');
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.pull_request.html_url}}', process.env.PR_TITLE);

discussion:
if: github.event_name == 'discussion' && contains(github.event.discussion.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -156,10 +159,11 @@ jobs:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
DISCUSSION_TITLE: ${{ github.event.discussion.title }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.discussion.html_url}}', '${{github.event.discussion.title}}');
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.discussion.html_url}}', process.env.DISCUSSION_TITLE);

issue_comment:
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members') }}
Expand Down Expand Up @@ -201,10 +205,11 @@ jobs:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
ISSUE_TITLE: ${{ github.event.issue.title }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}');
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}', process.env.ISSUE_TITLE);

pr_comment:
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -246,10 +251,11 @@ jobs:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
PR_TITLE: ${{ github.event.issue.title }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.issue.title}}');
sendEmail('${{github.event.comment.html_url}}', process.env.PR_TITLE);

discussion_comment:
if: github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@asyncapi/tsc_members')
Expand Down Expand Up @@ -291,7 +297,8 @@ jobs:
CALENDAR_ID: ${{ secrets.CALENDAR_ID }}
CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }}
MAILCHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_KEY }}
DISCUSSION_TITLE: ${{ github.event.discussion.title }}
with:
script: |
const sendEmail = require('./.github/workflows/scripts/mailchimp/index.js');
sendEmail('${{github.event.comment.html_url}}', '${{github.event.discussion.title}}');
sendEmail('${{github.event.comment.html_url}}', process.env.DISCUSSION_TITLE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you modify it because the linter complained?

I wonder then why github.event.comment.html_url did not have to be refactored as well 🤔

12 changes: 11 additions & 1 deletion .github/workflows/validate-workflow-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/checkout@v2
uses: actions/checkout@v4


- name: Install actionlint
run: |
curl -sLO https://github.com/rhysd/actionlint/releases/download/v1.6.3/actionlint_1.6.3_linux_amd64.tar.gz
tar xzf actionlint_1.6.3_linux_amd64.tar.gz
chmod +x actionlint
sudo mv actionlint /usr/local/bin/

- name: Run actionlint
run: actionlint -color

- name: Install Dependencies
mhmohona marked this conversation as resolved.
Show resolved Hide resolved
run: npm install yaml-lint ajv axios js-yaml

Expand Down Expand Up @@ -69,4 +79,4 @@ jobs:
}
}
}
validateWorkflows();
validateWorkflows();
Loading