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

ARROW-1234: Test A #8

Closed
wants to merge 2 commits into from
Closed
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
13 changes: 13 additions & 0 deletions .github/workflows/pull-request-title-comment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Thanks for opening a pull request!

Could you open an issue for this pull request on JIRA?
https://issues.apache.org/jira/browse/ARROW

Then could you also rename pull request title in the following format?

ARROW-\${JIRA_ID}: [${COMPONENT}] ${SUMMARY}

See also:

* [Other pull requests](https://github.com/apache/arrow/pulls/)
* [Contribution Guidelines - How to contribute patches](https://arrow.apache.org/docs/developers/contributing.html#how-to-contribute-patches)
80 changes: 80 additions & 0 deletions .github/workflows/pull-request-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Pull request title
on:
schedule:
# - cron: |
# */15 * * * *
- cron: |
3 * * * *
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Check pull request title
uses: actions/github-script@0.2.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const {owner: owner, repo: repo} = context.repo;

function haveJIRAID(title) {
if (!title) {
return false;
}
return /^ARROW-\d+/.test(title);
}

async function commentOpenJIRAIssue(pullRequestNumber) {
const {data: comments} = await github.issues.listComments({
owner: owner,
repo: repo,
issue_number: pullRequestNumber,
per_page: 1
});
if (comments.length > 0) {
return;
}
const response = await github.repos.getContents({
owner: owner,
repo: repo,
path: ".github/workflows/pull-request-title-comment.md",
ref: context.sha
});
await github.issues.createComment({
owner: owner,
repo: repo,
issue_number: pullRequestNumber,
body: response.data.content
});
}

(async () => {
const {data: pulls} = await github.pulls.list({
owner: owner,
repo: repo,
});
pulls.forEach(async (pull) => {
const pullRequestNumber = pull.number;
const title = pull.title;
if (!haveJIRAID(title)) {
await commentOpenJIRAIssue(pullRequestNumber);
}
});
})();
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ integrations in other projects, we'd be happy to have you involved:
[3]: https://issues.apache.org/jira/browse/ARROW
[4]: https://github.com/apache/arrow
[5]: https://github.com/apache/arrow/blob/master/docs/source/developers/contributing.rst