Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
allada committed Jul 27, 2024
1 parent 20f44a5 commit 6744b51
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 27 deletions.
62 changes: 35 additions & 27 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
name: CI
# name: CI

on:
push:
branches: [ main ]
pull_request_target:
branches: [ main ]
# on:
# push:
# branches: [ main ]
# pull_request_target:
# branches: [ main ]

permissions: read-all
# permissions: read-all

jobs:
auth:
environment: Production
# Add "id-token" with the intended permissions.
permissions:
id-token: write
actions: read
pull-requests: read
# jobs:
# auth:
# environment: Production
# # Add "id-token" with the intended permissions.
# permissions:
# id-token: write
# actions: read
# pull-requests: read

runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PAT_TOKEN }}
event-type: nl-token-event
client-payload: '{"ref": "${{ github.ref_name }}", "sha": "${{ github.sha }}", "token": "${{ secrets.FOO }}"}'
- name: Foo
run: echo ${{ github.event.pull_request.number }}
- name: Token dump
run: env
# runs-on: ubuntu-latest
# steps:
# - name: Repository Dispatch
# uses: peter-evans/repository-dispatch@v3
# with:
# token: ${{ secrets.PAT_TOKEN }}
# event-type: nl-token-event
# client-payload: '{"ref": "${{ github.ref_name }}", "sha": "${{ github.sha }}", "token": "${{ secrets.FOO }}"}'

# - name: Set commit status as pending
# uses: myrotvorets/set-commit-status-action@master
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# status: pending
# context: Publish NPM package

# - name: Foo
# run: echo ${{ github.event.pull_request.number }}
# - name: Token dump
# run: env
14 changes: 14 additions & 0 deletions .github/workflows/reusable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Call a reusable workflow and use its outputs

on:
workflow_dispatch:

jobs:
job1:
uses: TraceMachina/test-github-actions/.github/workflows/temp-key.yaml@main

job2:
runs-on: ubuntu-latest
needs: job1
steps:
- run: echo ${{ needs.job1.outputs.firstword }} ${{ needs.job1.outputs.secondword }}
27 changes: 27 additions & 0 deletions .github/workflows/temp-key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Get key

on:
workflow_call:
# Map the workflow outputs to job outputs
outputs:
token:
description: "my token"
value: ${{ jobs.my_job.outputs.token }}

jobs:
my_job:
environment: Production
permissions:
id-token: write
actions: read
pull-requests: read

name: Generate output
runs-on: ubuntu-latest
# Map the job outputs to step outputs
outputs:
token: ${{ steps.step1.outputs.token }}
steps:
- id: step1
run: echo "token=${{ secrets.FOO }}" >> $GITHUB_OUTPUT && echo ${{ vars.BAR }}
steps:

0 comments on commit 6744b51

Please sign in to comment.