Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
9 changes: 0 additions & 9 deletions .github/main.workflow

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm ci
- run: npm run build
- run: rm .gitignore # allow to commit /dist
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: "git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v2.x"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Test"
on: pull_request

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm ci
- run: npm test
- run: npm run build
- uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

20 changes: 10 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Expand Down
18 changes: 0 additions & 18 deletions Dockerfile

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ An example workflow looks like this (switch to the <kbd>`<> Edit new file`</kbd>
name: WIP
on:
pull_request:
types: [ opened, synchronize, reopened, edited ]
types: [opened, synchronize, reopened, edited]

jobs:
wip:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: wip/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

Then to prevent PRs from being merged, enable the `WIP (action)` status check in your Settings > Branch > [Branch Name] > Protect matching branches > Require status checks to pass before merging

## Contributing

I don't plan to add more features to it. It's only 10 lines of code, a great reference action to build one that matches your needs :)

## License

[MIT](LICENSE)
[Apache 2.0](LICENSE)
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: WIP
description: "DO NOT MERGE – as an action"
branding:
icon: "alert-triangle"
color: yellow
runs:
using: "node12"
main: "dist/index.js"
26 changes: 15 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
const { Toolkit } = require('actions-toolkit')
const { context, github: { request } } = new Toolkit()
const { Octokit } = require("@octokit/action");
const payload = require(process.env.GITHUB_EVENT_PATH);

const isWip = /\bwip\b/i.test(context.payload.pull_request.title)
const newStatus = isWip ? 'pending' : 'success'
const isWip = /\bwip\b/i.test(payload.pull_request.title);
const octokit = new Octokit();

// https://developer.github.com/v3/repos/statuses/#create-a-status
request('POST /repos/:owner/:repo/statuses/:sha', context.repo({
sha: context.payload.pull_request.head.sha,
state: newStatus,
target_url: 'https://github.com/wip/action',
description: isWip ? 'work in progress' : 'ready for review',
context: 'WIP (action)'
}))
octokit
.request("POST /repos/:owner/:repo/statuses/:sha", {
owner: payload.repository.owner.login,
repo: payload.repository.name,
sha: payload.pull_request.head.sha,
state: isWip ? "pending" : "success",
target_url: "https://github.com/wip/action",
description: isWip ? "work in progress" : "ready for review",
context: "WIP (action)",
})
.catch(console.error);
Loading