-
Notifications
You must be signed in to change notification settings - Fork 109
92 lines (90 loc) · 3.22 KB
/
release-community-pr.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
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
name: openshift community pull requests
on: [push]
jobs:
create-community-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
VERSION: vX.Y.Z
COMMUNITY_BRANCH_NAME: ${{ github.actor }}/datadog-operator-
# outputs:
# version: ${{ steps.set-version.outputs.version }}
# env:
## VERSION: ${${{ github.ref_name }}:1:5} # use version from release branch name
## COMMUNITY_BRANCH_NAME: ${{ github.actor }}/datadog-operator-v$VERSION
# VERSION: vX.Y.Z
# COMMUNITY_BRANCH_NAME: ${{ github.actor }}/datadog-operator-v${{env.VERSION}}
steps:
- name: setup env
run: |
# echo "VERSION=${${{ github.ref_name }}:1:5}" >> $GITHUB_ENV
echo "$VERSION"
echo "$COMMUNITY_BRANCH_NAME"
echo "COMMUNITY_BRANCH_NAME=$COMMUNITY_BRANCH_NAME + $VERSION" >> $GITHUB_ENV
echo "$COMMUNITY_BRANCH_NAME"
- name: validate env
run: |
echo "${{env.VERSION}}
echo "${{env.COMMUNITY_BRANCH_NAME}}
echo "$VERSION"
echo "$COMMUNITY_BRANCH_NAME"
# - name: create github token
# uses: actions/create-github-app-token@v1.6.2
# id: app-token
# with:
# app-id: ${{vars.GH_APP_ID}}
# private-key: ${{secrets.GH_APP_PRIVATE_KEY}}
# repositories: "datadog-operator,community-operators"
#
# - name: checkout fork
# uses: actions/checkout@v4
# with:
# repository: DataDog/community-operators
# token: ${{ secrets.GITHUB_TOKEN }}
#
# - name: sync fork
# env:
# GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# run: |
# git checkout -b $COMMUNITY_BRANCH_NAME
# git push -f --set-upstream origin $COMMUNITY_BRANCH_NAME
# gh repo sync DataDog/community-operators --branch $COMMUNITY_BRANCH_NAME \
# --source k8s-operatorhub/community-operators \
# --force
## gh repo sync DataDog/community-operators --branch release \
## --source k8s-operatorhub/community-operators \
## --force
#
# - name: checkout datadog-operator to tmp/ dir
# uses: actions/checkout@v4
# with:
# repository: Datadog/datadog-operator
# token: ${{ secrets.GITHUB_TOKEN }}
# path: tmp/
# - name: update bundle
# run: |
# mkdir operators/datadog-operator/${{ env.VERSION }}
# cp -R ./tmp/bundle/* operators/datadog-operator/$VERSION
#
# - name: Configure git user
# run: |
# git config user.name ${{ github.actor }}
# git config user.email ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
#
# - name: create PR
# env:
# GITHUB_TOKEN: $GITHUB_TOKEN
# run: |
# message="test PR"
# body="test PR"
# git checkout -b $COMMUNITY_BRANCH_NAME
# git add -A
# git commit -s -m "$message"
# git push -f --set-upstream origin $COMMUNITY_BRANCH_NAME
# gh pr create --title "$message" \
# --body "$body" \
# --repo DataDog/community-operators \
# --base main \
# --draft