This action is used to notify deployments in kubernetes via Slack
Check action.yml
for the full list of inputs.
uses: actions/actions-notify-slack-k8s@v1
with:
slack-access-token: ${{ secrets.SLACK_ACCESS_TOKEN }}
commit-url: ${{ github.event.commit.html_url }}
commit-author-username: ${{ github.event.commit.author.login }}
commit-author-email: ${{ github.event.commit.commit.author.email }}
commit-message: ${{ github.event.commit.commit.message }}
This project is built with TypeScript and can be tested locally.
- Node.js (v20 or later)
- npm
- Install dependencies:
npm install
- Build the project:
npm run build
Run the Jest unit tests:
npm test
Test the action locally with real environment variables:
- Copy the environment template:
cp .env.example .env
-
Edit
.env
with your actual values:SLACK_ACCESS_TOKEN
: Your Slack bot token (starts withxoxb-
)COMMIT_URL
: GitHub commit URLCOMMIT_AUTHOR_USERNAME
: GitHub usernameCOMMIT_AUTHOR_EMAIL
: Author emailCOMMIT_MESSAGE
: Commit message (supports multiline)
-
Run the local test:
npm run test:local
This will execute the action using your .env
values and send an actual Slack message.
Package the action for distribution:
npm run package
This creates a bundled dist/index.js
file that GitHub Actions will execute.