Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use semicolon and trailing commas #56

Merged
merged 1 commit into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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