-
Notifications
You must be signed in to change notification settings - Fork 68.9k
57 lines (48 loc) · 1.94 KB
/
Copy pathdont-delete-features.yml
File metadata and controls
57 lines (48 loc) · 1.94 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
name: Don't delete features
# Fails feature-deletion PRs because translations still use deleted English features.
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'data/features/**'
- .github/workflows/dont-delete-features.yml
permissions:
contents: read
pull-requests: write
jobs:
dont-delete-features:
if: github.event.pull_request.user.login != 'docs-bot' && github.event.pull_request.user.login != 'docs-engineering-bot[bot]' && (github.repository == 'github/docs-internal' || github.repository == 'github/docs')
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ./.github/actions/node-npm-setup
- name: Get comment markdown
id: comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run deleted-features-pr-comment
- name: Find possible previous comment
if: ${{ steps.comment.outputs.markdown != '' }}
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad
id: findComment
with:
issue-number: ${{ github.event.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- DELETED_FEATURES -->'
- name: Update comment
if: ${{ steps.comment.outputs.markdown != '' }}
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
with:
comment-id: ${{ steps.findComment.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body: ${{ steps.comment.outputs.markdown }}
edit-mode: replace
- name: Ultimately fail the workflow for attention
if: ${{ steps.comment.outputs.markdown != '' }}
run: |
echo "This PR deletes or renames one or more feature files."
echo "See the PR comment for how to get them back."
exit 1