Skip to content

Commit

Permalink
version
Browse files Browse the repository at this point in the history
  • Loading branch information
fanny-jiang committed Dec 29, 2023
1 parent 6b8893c commit 5006453
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/release-community-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ jobs:
permissions:
contents: write
pull-requests: write
# outputs:
# version: ${{ steps.set-version.outputs.version }}
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
VERSION: ${${{ github.ref_name }}:1:5} # use version from release branch name
COMMUNITY_BRANCH_NAME: ${{ github.actor }}/datadog-operator-${{ github.ref_name }}
steps:
# - name: set version
# id: set-version
# run: |
# echo "${${{ github.ref_name }}:1:5}" >> "$VERSION"
- name: create github token
uses: actions/create-github-app-token@v1.6.2
id: app-token
Expand All @@ -15,17 +25,18 @@ jobs:
private-key: ${{secrets.GH_APP_PRIVATE_KEY}}
repositories: "datadog-operator,community-operators"
- name: sync fork
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# env:
# GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
gh repo sync DataDog/community-operators --branch new-version \
git checkout -b $COMMUNITY_BRANCH_NAME
gh repo sync DataDog/community-operators --branch $COMMUNITY_BRANCH_NAME \
--source k8s-operatorhub/community-operators \
--force
- name: checkout fork
uses: actions/checkout@v4
with:
repository: DataDog/community-operators
token: ${{ steps.app-token.outputs.token }}
token: $GITHUB_TOKEN

- name: checkout datadog-operator to tmp/ dir
uses: actions/checkout@v4
Expand All @@ -35,25 +46,22 @@ jobs:
path: tmp/
- name: update bundle
run: |
mkdir operators/datadog-operator/test-version
cp -R ./tmp/bundle/* operators/datadog-operator/test-version
mkdir operators/datadog-operator/$VERSION
cp -R ./tmp/bundle/* operators/datadog-operator/$VERSION
- name: Configure git user
run: |
echo "Github ACTOR: ${{ github.actor }}"
echo "Github ACTOR ID: ${{ github.actor_id }}"
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: ${{ steps.app-token.outputs.token }}
# env:
# GITHUB_TOKEN: $GITHUB_TOKEN
run: |
message="test PR"
body="test PR"
branch="community-prs-new"
git checkout -b $branch
git checkout -b $COMMUNITY_BRANCH_NAME
git add -A
git commit -s -m "$message"
git push -f --set-upstream origin $branch
git push -f --set-upstream origin $COMMUNITY_BRANCH_NAME
gh pr create --title "$message" \
--body "$body" \
--repo DataDog/community-operators \
Expand Down

0 comments on commit 5006453

Please sign in to comment.