Skip to content

Commit

Permalink
move secrets to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold committed Feb 9, 2024
1 parent 871e1b1 commit bb0d0d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/actions/generate-sandboxes-composite-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ inputs:
destination-branch:
description: The destination branch to generate sandboxes to in the storybookjs/sandboxes repository
required: true
token:
description: The personal access token to use when authenticating with the destination repository
required: true
discord-url:
description: The Discord URL to use when reporting failures
required: true

runs:
using: "composite"
Expand Down Expand Up @@ -50,12 +56,12 @@ runs:

- name: Publish
shell: bash
run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=${{ inputs.destination-branch }}
run: yarn publish-sandboxes --remote=https://storybook-bot:${{ inputs.token }}@github.com/storybookjs/sandboxes.git --push --branch=${{ inputs.destination-branch }}

- name: The job has failed
if: ${{ failure() || cancelled() }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }}
DISCORD_WEBHOOK: ${{ inputs.discord-url }}
uses: Ilshidur/action-discord@master
with:
args: "The generation of sandboxes in the **${{ inputs.destination-branch }}** branch has failed. [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
7 changes: 7 additions & 0 deletions .github/workflows/generate-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:

jobs:
generate-next:
name: Generate to next
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -23,7 +24,11 @@ jobs:
- uses: ./.github/actions/generate-sandboxes-composite-action
with:
destination-branch: next
token: ${{ secrets.PAT_STORYBOOK_BOT }}
discord-url: ${{ secrets.DISCORD_MONITORING_URL }}

# generate-main:
# name: Generate to main
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
Expand All @@ -32,3 +37,5 @@ jobs:
# - uses: ./.github/actions/generate-sandboxes-composite-action
# with:
# destination-branch: main
# token: ${{ secrets.PAT_STORYBOOK_BOT }}
# discord-url: ${{ secrets.DISCORD_MONITORING_URL }}

0 comments on commit bb0d0d0

Please sign in to comment.