Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erezrokah/2fa-with-slack-action
A GitHub Action to publish a package with 2FA using Slack
https://github.com/erezrokah/2fa-with-slack-action
Last synced: 2 months ago
JSON representation
A GitHub Action to publish a package with 2FA using Slack
- Host: GitHub
- URL: https://github.com/erezrokah/2fa-with-slack-action
- Owner: erezrokah
- License: mit
- Archived: true
- Created: 2020-02-06T09:32:03.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-04-11T07:09:40.000Z (almost 3 years ago)
- Last Synced: 2024-08-02T07:23:05.290Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 3.13 MB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-actions - Publish a package with 2FA using Slack
- fucking-awesome-actions - Publish a package with 2FA using Slack
- awesome-workflows - Publish a package with 2FA using Slack
README
# 2fa-with-slack-action
## Deprecated ⚠️
I recommend using [npm automation tokens](https://github.blog/changelog/2020-10-02-npm-automation-tokens/) or [Wombat Dressing Room](https://github.com/GoogleCloudPlatform/wombat-dressing-room) to automate publishing to `npm`.
## Usage
```yaml
on: [repository_dispatch]jobs:
publish:
runs-on: ubuntu-latest
name: Publish an NPM Package
steps:
- name: 2FA Publish step
uses: erezrokah/2fa-with-slack-action@v1
env:
# npm token with publish permissions
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
# slack token with bot scopes of `app_mentions:read,channels:history,channels:join,chat:write` and `groups.history` for private channel access
SLACK_TOKEN: ${{secrets.SLACK_TOKEN}}
# channel id of slack channel to send the 2FA request message
CHANNEL_ID: ${{secrets.CHANNEL_ID}}
# line break separated list of command and args that perform the publish
PUBLISH_COMMAND: "npm\npublish"
# pattern to match on publish command output when token is needed
CODE_PATTERN: 'Enter OTP'
# (optional) line break separated list of command and args to run when the publish fails
REVERT_COMMAND: "git\nrevert\nHEAD"
```