-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add instructions for developing with a local version of the action #250
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a0c3008
add instructions for experimenting with local workflow runs
zimeg 81fd170
oneline the instructions in maintainers guide
zimeg f3f0846
fix: the link in maintainers guide
zimeg 65fbd5d
typo: copy -> version
zimeg 9d9d95e
typo: copy -> version
zimeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Rename this file to .env and update any variables to get started | ||
|
||
SLACK_BOT_TOKEN=xoxb-01010101-abcdefgh | ||
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T0123456789/B0123456789/abcdefghijklmnopqrstuvwxyz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Secret variables | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Local runs | ||
|
||
For a simple development experience, a local version of this action can be used in experiments. | ||
|
||
**Requirements**: | ||
|
||
- An installation of [nektos/act](https://github.com/nektos/act) | ||
|
||
## Configuring secrets | ||
|
||
To use `${{ secrets.* }}` in the workflow, move `.env.example` to `.env` and update any variables. | ||
|
||
## Mocking event payloads | ||
|
||
Different event payloads can be mocked directly with changes to the `event.json` file. | ||
|
||
Reference: https://docs.github.com/en/webhooks/webhook-events-and-payloads | ||
|
||
## Updating the workflow | ||
|
||
The `local.yml` file contains the workflow used for testing. Updates to these steps can be made to test various functionalities. | ||
|
||
## Running an experiment | ||
|
||
Run the workflow using `npm run local`. The above configurations will be used to simulate an actual workflow run. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"pull_request": { | ||
"user": { | ||
"login": "dependabot" | ||
}, | ||
"title": "Bump actions/checkout from 3 to 4", | ||
"html_url": "https://github.com/slackapi/slack-github-action/pull/238" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Local run | ||
|
||
# Requires mocking the "public" event to begin this workflow and avoid actual runs | ||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows | ||
on: | ||
public: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout action | ||
uses: actions/checkout@v4 | ||
- name: Build action | ||
run: npm install && npm run build | ||
- name: Send a message into channel | ||
id: slack | ||
uses: ./. | ||
with: | ||
payload: | | ||
{ | ||
"repository": "${{ github.repository }}", | ||
"pull_request_username": "${{ github.event.pull_request.user.login }}", | ||
"pull_request_title": ${{ toJSON(github.event.pull_request.title) }}, | ||
"pull_request_url": "${{ github.event.pull_request.html_url }}" | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know this tool 👍