You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by gi...@apache.org on 2020/12/28 12:10:05 UTC

[airflow-pre-commit-action] 01/01: Deployed to github pages

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/airflow-pre-commit-action.git

commit 4e9eea0dd48ddeca566ce88be06df4366c67f5d1
Author: Github Actions <41...@users.noreply.github.com>
AuthorDate: Mon Dec 28 12:09:51 2020 +0000

    Deployed to github pages
---
 LICENSE       | 19 ++++++++++++++
 README.md     | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 action.yml    | 13 ++++++++++
 dist/index.js | 14 ++++++++++
 4 files changed, 128 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..5a4128d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2019 Anthony Sottile
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e6ef41e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,82 @@
+[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pre-commit/action/master.svg)](https://results.pre-commit.ci/latest/github/pre-commit/action/master)
+[![Build Status](https://github.com/pre-commit/action/workflows/deploy/badge.svg)](https://github.com/pre-commit/action/actions)
+
+pre-commit/action
+=================
+
+a GitHub action to run [pre-commit](https://pre-commit.com)
+
+### using this action
+
+To use this action, make a file `.github/workflows/pre-commit.yml`.  Here's a
+template to get started:
+
+```yaml
+name: pre-commit
+
+on:
+  pull_request:
+  push:
+    branches: [master]
+
+jobs:
+  pre-commit:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+    - uses: actions/setup-python@v2
+    - uses: pre-commit/action@v2.0.0
+```
+
+This does a few things:
+
+- clones the code
+- installs python
+- sets up the `pre-commit` cache
+
+### using this action with custom invocations
+
+By default, this action runs all the hooks against all the files.  `extra_args`
+lets users specify a single hook id and/or options to pass to `pre-commit run`.
+
+Here's a sample step configuration that only runs the `flake8` hook against all
+the files (use the template above except for the `pre-commit` action):
+
+```yaml
+    - uses: pre-commit/action@v2.0.0
+      with:
+        extra_args: flake8 --all-files
+```
+
+### using this action in private repositories
+
+this action also provides an additional behaviour when used in private
+repositories.  when configured with a github token, the action will push back
+fixes to the pull request branch.
+
+using the template above, you'll make two replacements for individual actions:
+
+first is the checkout step, which needs to use unlimited fetch depth for
+pushing
+
+```yaml
+    - uses: actions/checkout@v2
+      with:
+        fetch-depth: 0
+```
+
+next is passing the token to the pre-commit action
+
+```yaml
+    - uses: pre-commit/action@v2.0.0
+      with:
+        token: ${{ secrets.GITHUB_TOKEN }}
+```
+
+note that `secrets.GITHUB_TOKEN` is automatically provisioned and will not
+require any special configuration.
+
+while you could _technically_ configure this for a public repository (using a
+personal access token), I can't think of a way to do this safely without
+exposing a privileged token to pull requests -- if you have any ideas, please
+leave an issue!
diff --git a/action.yml b/action.yml
new file mode 100644
index 0000000..9906815
--- /dev/null
+++ b/action.yml
@@ -0,0 +1,13 @@
+name: pre-commit
+description: run pre-commit and optionally commit back to the pull request
+inputs:
+  extra_args:
+    description: options to pass to pre-commit run
+    required: false
+    default: '--all-files'
+  token:
+    description: github token to clone / push with
+    required: false
+runs:
+  using: 'node12'
+  main: 'dist/index.js'
diff --git a/dist/index.js b/dist/index.js
new file mode 100644
index 0000000..5fb465d
--- /dev/null
+++ b/dist/index.js
@@ -0,0 +1,14 @@
+!function(e){var t={};function r(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typ [...]
+/*!
+ * isobject <https://github.com/jonschlinkert/isobject>
+ *
+ * Copyright (c) 2014-2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+/*!
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
+ *
+ * Copyright (c) 2014-2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+function n(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function i(e){var t,r;return!1!==n(e)&&("function"==typeof(t=e.constructor)&&(!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}function a(e,t,r){if("string"==typeof t){let[e,o]=t.split(" ");r=Object.assign(o?{method:e,url:o}:{url:e},r)}else r=Object.assign({},t);var o;r.headers=(o=r.headers)?Object.keys(o).reduce((e,t)=>(e[t.toLowerC [...]
\ No newline at end of file