@@ -10,6 +10,8 @@ concurrency:
10
10
group : " ${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"
11
11
cancel-in-progress : true
12
12
13
+ permissions : {}
14
+
13
15
jobs :
14
16
changes :
15
17
name : " changes"
@@ -39,17 +41,20 @@ jobs:
39
41
comment-chromatic-start :
40
42
uses : " ./.github/workflows/comment-queue.yml"
41
43
needs : changes
42
- if : ${{ needs.changes.outputs.should_run == 'true' }}
44
+ if : needs.changes.outputs.should_run == 'true' || contains(needs.changes.outputs.labels, 'no-visual-update')
43
45
secrets :
44
46
gh_token : ${{ secrets.COMMENT_TOKEN }}
45
47
with :
46
48
pr_number : ${{ needs.changes.outputs.pr_number }}
47
49
message : |
48
50
storybook~pending~null
49
51
update-status :
52
+ permissions :
53
+ actions : read
54
+ statuses : write
50
55
runs-on : ubuntu-latest
51
56
needs : changes
52
- if : ${{ github.event.workflow_run.conclusion == 'success' && ( needs.changes.outputs.should_run == 'false' || contains(needs.changes.outputs.labels, 'no-visual-update')) }}
57
+ if : needs.changes.outputs.should_run == 'false' || contains(needs.changes.outputs.labels, 'no-visual-update')
53
58
steps :
54
59
- name : update status
55
60
uses : gradio-app/github/actions/set-commit-status@main
@@ -59,18 +64,19 @@ jobs:
59
64
name : " UI Tests"
60
65
run_id : ${{ needs.changes.outputs.run_id }}
61
66
deploy :
67
+ permissions :
68
+ actions : read
69
+ contents : read
62
70
environment : storybook
63
71
name : " storybook-deploy"
64
72
needs : changes
65
- if : ${{ github.event.workflow_run.conclusion == 'success' && needs.changes.outputs.should_run == 'true' && github.repository == 'gradio-app/gradio' && !contains(needs.changes.outputs.labels, 'no-visual-update') }}
73
+ if : needs.changes.outputs.should_run == 'true' && github.repository == 'gradio-app/gradio' && !contains(needs.changes.outputs.labels, 'no-visual-update')
66
74
runs-on : ubuntu-latest
67
75
outputs :
68
76
changes : ${{ steps.publish-chromatic.outputs.changeCount }}
69
77
errors : ${{ steps.publish-chromatic.outputs.errorCount }}
70
78
storybook_url : ${{ steps.publish-chromatic.outputs.storybookUrl }}
71
79
build_url : ${{ steps.publish-chromatic.outputs.buildUrl }}
72
- permissions :
73
- actions : read
74
80
steps :
75
81
- uses : actions/checkout@v4
76
82
with :
@@ -104,14 +110,14 @@ jobs:
104
110
secrets :
105
111
gh_token : ${{ secrets.COMMENT_TOKEN }}
106
112
with :
107
- pr_number : ${{ github.event.workflow_run.conclusion == 'success' && needs.changes.outputs.pr_number }}
113
+ pr_number : ${{ needs.changes.outputs.pr_number }}
108
114
message : |
109
115
storybook~success~${{ needs.deploy.outputs.storybook_url }}
110
116
111
117
comment-chromatic-fail :
112
118
uses : " ./.github/workflows/comment-queue.yml"
113
119
needs : [deploy, changes]
114
- if : always() && github.event.workflow_run.conclusion == 'success' && needs.deploy.result == 'failure'
120
+ if : always() && needs.deploy.result == 'failure'
115
121
secrets :
116
122
gh_token : ${{ secrets.COMMENT_TOKEN }}
117
123
with :
0 commit comments