-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (112 loc) · 3.8 KB
/
Copy pathdebug.yml
File metadata and controls
136 lines (112 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Simple workflow for debugging github actions
name: DEBUG
run-name: DEBUG ${{ github.ref }}
on:
# Triggers the workflow on push or pull request events but only for branches beginning with 'task' that have changes in the migrations folder.
push:
branches:
- 'debug**'
# Allows you to run this workflow manually from the Actions tab AND from other actions (fwTaskPushCreateCheck)
workflow_dispatch:
# permissions:
# actions: read|write|none
# checks: read|write|none
# contents: read|write|none
# deployments: read|write|none
# issues: read|write|none
# packages: read|write|none
# pull-requests: read|write|none
# repository-projects: read|write|none
# security-events: read|write|none
# statuses: read|write|none
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pull-requests: write
actions: write
# Allow one concurrent deployment
concurrency:
group: "debug"
cancel-in-progress: true
jobs:
job1:
environment: DEBUG_ENVIRONMENT
env:
ACTIONS_RUNNER_DEBUG: true
GH_TOKEN: ${{ github.token }}
GITHUB_CONTEXT: ${{ toJson(github) }}
SECRETS_CONTEXT: ${{ toJson(secrets) }}
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
NEEDS_CONTEXT: ${{ toJson(needs) }}
runs-on: self-hosted
steps:
- name: Echo Contexts
run: |
echo "$env:GITHUB_CONTEXT"
echo "$env:SECRETS_CONTEXT"
echo "$env:STRATEGY_CONTEXT"
echo "$env:MATRIX_CONTEXT"
echo "$env:NEEDS_CONTEXT"
- name: Get/Set deployment environment
run: |
$deployments = curl ${{ github.event.repository.deployments_url }} | ConvertFrom-Json
echo "deployment_environment=$( $deployments[0] | select -expand environment )" >> $env:GITHUB_ENV
- name: View deployment environment
run: |
echo "$env:deployment_environment"
- name: Set the value
id: step_one
run: |
echo "action_state=yellow" >> $env:GITHUB_ENV
- name: Use the value
id: step_two
run: |
echo "${{ env.action_state }}" # This will output 'yellow'
# Test Context
- name: Echo Context
id: echo_context
run: |
echo "${{ env.deployment_environment }}"
# Test setting env
- name: Set Env
run: |
echo "dir_exists=$(Test-Path ${{ env.deployment_environment }})" >> $env:GITHUB_ENV
- name: Set Env 2
run: |
echo "dir_2=2" >> $env:GITHUB_ENV
# Read env 2
- name: Read env.dir_2
run: |
echo ${{ env.dir_2 }}
# Read env
- name: Read Env
run: |
echo ${{ env }}
# Read env dir_exists
- name: Read env.dir_exists
run: |
echo ${{ env.dir_exists }}
- name: Checkout
uses: actions/checkout@v3
- name: Comment Pull Request Start
run: |
gh pr comment --body "DEBUG START"
# Test output
- name: Echo Commands
id: echo
run: |
echo "Test" > output.txt
echo "TEST=test" >> $env:GITHUB_OUTPUT
echo "TEST1=$(cat output.txt)" >> $env:GITHUB_OUTPUT
- name: Test Echo
run: |
echo "test=${{ steps.echo.outputs.TEST }}"
echo "test1=${{ steps.echo.outputs.TEST1 }}"
# - name: Comment Pull Request End
# run: |
# echo "test=${{ steps.echo.outputs.TEST }}"
# gh pr comment --body "DEBUG END"- name: Comment Pull Request End
- name: Trigger Run Log Comment On Pull Request
run: |
gh workflow run commentLog.yml -r ${{ github.ref }} -f run_id="${{ github.run_id }}"