Skip to content

Commit

Permalink
Merge pull request #3661 from dev-hato/fix_owner
Browse files Browse the repository at this point in the history
CIでのorganization名取得をスクリプト内で行う
  • Loading branch information
massongit authored Feb 10, 2024
2 parents c8de1df + 6745b1c commit 33b4455
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 25 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/pr-merge-develop-hato-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,9 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Set org name
uses: actions/github-script@v7.0.1
id: set_org_name
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: return process.env.GITHUB_REPOSITORY.split('/')[0]
- name: Get PullRequests
uses: actions/github-script@v7.0.1
id: get_pull_requests
env:
ORG_NAME: ${{steps.set_org_name.outputs.result}}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand All @@ -33,8 +24,6 @@ jobs:
- name: Create PullRequest
uses: actions/github-script@v7.0.1
if: ${{ steps.get_pull_requests.outputs.result == 0 }}
env:
ORG_NAME: ${{steps.set_org_name.outputs.result}}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/pr-release-hato-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,10 @@ jobs:
- name: Get diff
id: get_diff
run: bash "${GITHUB_WORKSPACE}/scripts/pr_release_hato_bot/pr_release/get_diff.sh"
- name: Set org name
uses: actions/github-script@v7.0.1
id: set_org_name
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: return process.env.GITHUB_REPOSITORY.split('/')[0]
- name: Get PullRequests
uses: actions/github-script@v7.0.1
if: ${{ steps.get_diff.outputs.result != '' }}
id: get_pull_requests
env:
ORG_NAME: ${{steps.set_org_name.outputs.result}}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand All @@ -36,8 +27,6 @@ jobs:
- name: Create PullRequest
uses: actions/github-script@v7.0.1
if: ${{ steps.get_diff.outputs.result != '' && steps.get_pull_requests.outputs.result == 0 }}
env:
ORG_NAME: ${{steps.set_org_name.outputs.result}}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
2 changes: 1 addition & 1 deletion scripts/get_pull_requests_hato_bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = async ({ github, context }) => {
const pullsListParams = {
owner: context.repo.owner,
repo: context.repo.repo,
head: process.env.ORG_NAME + ':develop',
head: context.repo.owner + ':develop',
base: 'master',
state: 'open'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = async ({ github, context }) => {
repo: context.repo.repo
}
const pullsCreateParams = {
head: process.env.ORG_NAME + ':master',
head: context.repo.owner + ':master',
base: 'develop',
title: 'master -> develop',
body: '鳩の歴史は同期される\ndevelopに新たなコミットがpushされる前にマージしてね!',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = async ({ github, context }) => {
repo: context.repo.repo
}
const pullsCreateParams = {
head: process.env.ORG_NAME + ':develop',
head: context.repo.owner + ':develop',
base: 'master',
title: 'リリース',
body: '鳩は唐揚げになるため、片栗粉へ飛び込む',
Expand Down

0 comments on commit 33b4455

Please sign in to comment.