-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (55 loc) · 2 KB
/
block-deprecated_assets.yml
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
name: Block PRs on deprecated apps and libs
on:
pull_request:
types: [opened, synchronize, reopened, edited]
# Default to bash
defaults:
run:
shell: bash
jobs:
changes:
runs-on: [ubuntu-latest]
outputs:
apps: ${{ steps.filters.outputs.apps }}
libs: ${{ steps.filters.outputs.libs }}
app-changes: ${{ steps.app-filters.outputs.changes }}
lib-changes: ${{ steps.lib-filters.outputs.changes }}
steps:
- name: Checkout Pull Request
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: dorny/paths-filter@v3
id: filters
with:
list-files: shell
filters: |
apps: apps_deprecated/**
libs: libs_deprecated/**
- name: Show outputs
run: |
echo "===================="
echo apps: ${{ steps.filters.outputs.apps}}
echo apps_files: ${{ steps.filters.outputs.apps_files}}
echo app changes: ${{ steps.app-filters.outputs.changes}}
echo libs: ${{ steps.filters.outputs.libs}}
echo libs_files: ${{ steps.filters.outputs.libs_files}}
echo lib changes: ${{ steps.lib-filters.outputs.changes}}
echo "===================="
evaluate-changes:
needs: changes
runs-on: [ubuntu-latest]
steps:
- name: Show inputs
run: |
echo apps: ${{ needs.changes.outputs.apps }}
echo libs: ${{ needs.changes.outputs.libs }}
echo app changes: ${{ needs.changes.outputs.app-changes }}
echo lib changes: ${{ needs.changes.outputs.lib-changes }}
- name: Check if changes belong to deprecated apps or libs
if: ${{ needs.changes.outputs.apps == 'true' || needs.changes.outputs.libs == 'true' }}
run: |
echo "::error not allowed to make changes to deprecated apps or libs"
exit 1