Skip to content

Commit

Permalink
Merge pull request #56 from ergebnis/fix/semicolon-and-comma
Browse files Browse the repository at this point in the history
Fix: Use semicolon and trailing commas
  • Loading branch information
localheinz authored Jan 21, 2022
2 parents a30345f + a782670 commit 7605eae
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.workflow_run.pull_requests[0]
const repository = context.repo
const pullRequest = context.payload.workflow_run.pull_requests[0];
const repository = context.repo;
const reviewers = [
"ergebnis-bot",
Expand All @@ -40,53 +40,53 @@ jobs:
repo: repository.repo,
pull_number: pullRequest.number,
reviewers: reviewers,
})
});
- name: "Assign @ergebnis-bot"
uses: "actions/github-script@v5"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.workflow_run.pull_requests[0]
const repository = context.repo
const pullRequest = context.payload.workflow_run.pull_requests[0];
const repository = context.repo;
const assignees = [
"ergebnis-bot",
]
];
await github.rest.issues.addAssignees({
owner: repository.owner,
repo: repository.repo,
assignees: assignees,
issue_number: pullRequest.number
})
});
- name: "Approve pull request"
uses: "actions/github-script@v5"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.workflow_run.pull_requests[0]
const repository = context.repo
const pullRequest = context.payload.workflow_run.pull_requests[0];
const repository = context.repo;
await github.rest.pulls.createReview({
event: "APPROVE",
owner: repository.owner,
repo: repository.repo,
pull_number: pullRequest.number,
})
});
- name: "Merge pull request"
uses: "actions/github-script@v5"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.workflow_run.pull_requests[0]
const repository = context.repo
const pullRequest = context.payload.workflow_run.pull_requests[0];
const repository = context.repo;
await github.rest.pulls.merge({
merge_method: "merge",
owner: repository.owner,
pull_number: pullRequest.number,
repo: repository.repo,
})
});
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ jobs:
owner: repository.owner,
repo: repository.repo,
tag_name: "${{ env.RELEASE_TAG }}",
})
});
core.exportVariable("RELEASE_BODY", response.data.body)
core.exportVariable("RELEASE_BODY", response.data.body);
- name: "Create release"
uses: "actions/github-script@v5"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
script: |
const repository = context.repo
const repository = context.repo;
await github.rest.repos.createRelease({
body: "${{ env.RELEASE_BODY }}",
Expand All @@ -47,4 +47,4 @@ jobs:
prerelease: false,
repo: repository.repo,
tag_name: "${{ env.RELEASE_TAG }}",
})
});
14 changes: 7 additions & 7 deletions .github/workflows/triage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ jobs:
const branchPrefixLabels = {
feature: "enhancement",
fix: "bug",
}
};
const pullRequest = context.payload.pull_request
const repository = context.repo
const pullRequest = context.payload.pull_request;
const repository = context.repo;
const branchName = pullRequest.head.ref
const branchName = pullRequest.head.ref;
const matches = branchName.match(new RegExp('^([^/]+)\/'));
const matches = branchName.match(new RegExp('^([^/]+)\/'));;
if (matches instanceof Array && branchPrefixLabels.hasOwnProperty(matches[1])) {
const label = branchPrefixLabels[matches[1]]
const label = branchPrefixLabels[matches[1]];
github.issues.addLabels({
issue_number: pullRequest.number,
labels: [
label
label,
],
owner: repository.owner,
repo: repository.repo,
Expand Down

0 comments on commit 7605eae

Please sign in to comment.