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

Backport workflow from master #5674

Merged
merged 1 commit into from
Mar 31, 2020
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
15 changes: 15 additions & 0 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Backport

on:
pull_request:
types:
- closed
- labeled

jobs:
backport:
runs-on: ubuntu-18.04
timeout-minutes: 5
name: Backport
steps:
- uses: camptocamp/backport-action@master
28 changes: 28 additions & 0 deletions .github/workflows/clean-ghpages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---

name: Clean GitHub pages

on:
delete

jobs:
clean:
runs-on: ubuntu-18.04
name: Clean GitHub pages
timeout-minutes: 5

steps:
- uses: actions/checkout@v1
with:
ref: gh-pages
- name: Clean ghpages
run: |
git config --global user.name "Continuous integration"
git config --global user.email "[email protected]"
if [ -d $(cat ${GITHUB_EVENT_PATH}|jq --raw-output .ref) ]
then
git rm -r $(cat ${GITHUB_EVENT_PATH}|jq --raw-output .ref)
git commit -m "Clean branch $(cat ${GITHUB_EVENT_PATH}|jq --raw-output .ref)"
remote_repo="https://${GITHUB_ACTOR}:${{ github.token }}@github.com/camptocamp/ngeo.git"
git push "${remote_repo}" gh-pages --force
fi
41 changes: 41 additions & 0 deletions .github/workflows/pr-title-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

name: Lint pull request title

on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize

jobs:
lint:
name: Lint pull request title
runs-on: ubuntu-18.04
timeout-minutes: 5

steps:
- run: echo Actor ${{ github.actor }}

- uses: morrisoncole/[email protected]
with:
title-regex: "^(\\[.*\\] )?[A-Z0-9].*"
on-failed-regex-comment: "The title should start with a capital."
repo-token: "${{ secrets.GITHUB_TOKEN }}"
if: github.actor != 'dependabot-preview[bot]'

- name: Update status
uses: ouzi-dev/[email protected]
with:
status: error
description: Global status
name: Pull request title
if: failure()
- name: Update status
uses: ouzi-dev/[email protected]
with:
status: success
description: Global status
name: Pull request title
37 changes: 37 additions & 0 deletions .github/workflows/test_url.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Add message on pull requests with the related examples

on:
pull_request:
types:
- opened

jobs:
all:
runs-on: ubuntu-latest
steps:
- run: npm install --production @actions/github
- run: |
echo "
const github = require('@actions/github');

async function run() {
// Get client and context
const client = new github.GitHub(process.env.GITHUB_TOKEN);

await client.pulls.createReview({
owner: github.context.issue.owner,
repo: github.context.issue.repo,
pull_number: github.context.issue.number,
body: [
\`Examples: https://camptocamp.github.io/ngeo/\${process.env.GITHUB_HEAD_REF}/examples/\`,
\`API documentation: https://camptocamp.github.io/ngeo/\${process.env.GITHUB_HEAD_REF}/apidoc/\`,
].join('\n'),
event: 'COMMENT'
});
}

run();
" > pr-message.js
- run: node pr-message.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}