You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2021/01/06 20:04:24 UTC

[beam] branch master updated: [BEAM-11569] Building wheels with airflow-clone of github-push action

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

pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 686b1ff  [BEAM-11569] Building wheels with airflow-clone of github-push action
     new 0183cdb2 Merge pull request #13677 from [BEAM-11569] Building wheels with airflow-clone of github-push action
686b1ff is described below

commit 686b1fffe3cf2bb61c5b9b282f63afc8937bcb7f
Author: Pablo Estrada <pa...@apache.org>
AuthorDate: Wed Jan 6 11:57:51 2021 -0800

    [BEAM-11569] Building wheels with airflow-clone of github-push action
---
 .github/actions/github-push-action/LICENSE    | 21 ---------
 .github/actions/github-push-action/README.md  | 59 ------------------------
 .github/actions/github-push-action/action.yml | 30 ------------
 .github/actions/github-push-action/start.js   | 66 ---------------------------
 .github/actions/github-push-action/start.sh   | 28 ------------
 .github/workflows/build_wheels.yml            |  2 +-
 6 files changed, 1 insertion(+), 205 deletions(-)

diff --git a/.github/actions/github-push-action/LICENSE b/.github/actions/github-push-action/LICENSE
deleted file mode 100644
index 3018069..0000000
--- a/.github/actions/github-push-action/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2019 Adam Dobrawy
-
-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/.github/actions/github-push-action/README.md b/.github/actions/github-push-action/README.md
deleted file mode 100644
index 8cdabfa..0000000
--- a/.github/actions/github-push-action/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# GitHub Action for GitHub Push
-
-The GitHub Actions for pushing to GitHub repository local changes authorizing using GitHub token.
-
-With ease:
-
-- update new code placed in the repository, e.g. by running a linter on it,
-- track changes in script results using Git as archive,
-- publish page using GitHub-Pages,
-- mirror changes to a separate repository.
-
-## Usage
-
-### Example Workflow file
-
-An example workflow to authenticate with GitHub Platform:
-
-```yaml
-jobs:
-  build:
-    runs-on: ubuntu-latest
-    steps:
-    - uses: actions/checkout@v2
-      with:
-        persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
-        fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
-    - name: Create local changes
-      run: |
-        ...
-    - name: Commit files
-      run: |
-        git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
-        git config --local user.name "github-actions[bot]"
-        git commit -m "Add changes" -a
-    - name: Push changes
-      uses: ad-m/github-push-action@master
-      with:
-        github_token: ${{ secrets.GITHUB_TOKEN }}
-        branch: ${{ github.ref }}
-```
-
-### Inputs
-
-| name | value | default | description |
-| ---- | ----- | ------- | ----------- |
-| github_token | string | | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. |
-| branch | string | (default) | Destination branch to push changes. Can be passed in using `${{ github.ref }}`. |
-| force | boolean | false | Determines if force push is used. |
-| tags | boolean | false | Determines if `--tags` is used. |
-| directory | string | '.' | Directory to change to before pushing. |
-| repository | string | '' | Repository name. Default or empty repository name represents current github repository. If you want to push to other repository, you should make a [personal access token](https://github.com/settings/tokens) and use it as the `github_token` input.  |
-
-## License
-
-The Dockerfile and associated scripts and documentation in this project are released under the [MIT License](LICENSE).
-
-## No affiliation with GitHub Inc.
-
-GitHub are registered trademarks of GitHub, Inc. GitHub name used in this project are for identification purposes only. The project is not associated in any way with GitHub Inc. and is not an official solution of GitHub Inc. It was made available in order to facilitate the use of the site GitHub.
diff --git a/.github/actions/github-push-action/action.yml b/.github/actions/github-push-action/action.yml
deleted file mode 100644
index b06932b..0000000
--- a/.github/actions/github-push-action/action.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-name: 'GitHub Push'
-description: 'Pushing to GitHub repository local changes'
-author: 'ad-m'
-branding:
-  icon: upload-cloud
-  color: green
-inputs:
-  github_token:
-    description: 'Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}'
-    required: true
-  repository:
-    description: 'Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})'
-    default: ''
-    required: false
-  branch:
-    description: 'Destination branch to push changes'
-    required: false
-  force:
-    description: 'Determines if force push is used'
-    required: false
-  tags:
-    description: 'Determines if --tags is used'
-    required: false
-  directory:
-    description: 'Directory to change to before pushing.'
-    required: false
-    default: '.'
-runs:
-  using: 'node12'
-  main: 'start.js'
diff --git a/.github/actions/github-push-action/start.js b/.github/actions/github-push-action/start.js
deleted file mode 100644
index 50c5d25..0000000
--- a/.github/actions/github-push-action/start.js
+++ /dev/null
@@ -1,66 +0,0 @@
-'use strict';
-const spawn = require('child_process').spawn;
-const path = require("path");
-const https = require('https');
-
-const get = (url, options = {}) => new Promise((resolve, reject) => https
-    .get(url, options, (res) => {
-        const chunks = [];
-        res.on('data', (chunk) => chunks.push(chunk));
-        res.on('end', () => {
-            const body = Buffer.concat(chunks).toString('utf-8');
-            if (res.statusCode < 200 || res.statusCode > 300) {
-                return reject(Object.assign(
-                    new Error(`Invalid status code '${res.statusCode}' for url '${url}'`),
-                    { res, body }
-                ));
-            }
-            return resolve(body)
-        });
-    })
-    .on('error', reject)
-)
-
-const exec = (cmd, args = [], options = {}) => new Promise((resolve, reject) =>
-    spawn(cmd, args, { stdio: 'inherit', ...options })
-        .on('close', code => {
-            if (code !== 0) {
-                return reject(Object.assign(
-                    new Error(`Invalid exit code: ${code}`),
-                    { code }
-                ));
-            };
-            return resolve(code);
-        })
-        .on('error', reject)
-);
-
-const trimLeft = (value, charlist = '/') => value.replace(new RegExp(`^[${charlist}]*`), '');
-const trimRight = (value, charlist = '/') => value.replace(new RegExp(`[${charlist}]*$`), '');
-const trim = (value, charlist) => trimLeft(trimRight(value, charlist));
-
-const main = async () => {
-    let branch = process.env.INPUT_BRANCH;
-    const repository = trim(process.env.INPUT_REPOSITORY || process.env.GITHUB_REPOSITORY);
-    if (!branch) {
-        const headers = {
-            'User-Agent': 'github.com/ad-m/github-push-action'
-        };
-        if (process.env.GITHUB_TOKEN) headers.Authorization = `token ${process.env.GITHUB_TOKEN}`;
-        const body = JSON.parse(await get(`https://api.github.com/repos/${repository}`, { headers }))
-        branch = body.default_branch;
-    }
-    await exec('bash', [path.join(__dirname, './start.sh')], {
-        env: {
-            ...process.env,
-            INPUT_BRANCH: branch,
-            INPUT_REPOSITORY: repository,
-        }
-    });
-};
-
-main().catch(err => {
-    console.error(err);
-    console.error(err.stack);
-    process.exit(err.code || -1);
-})
diff --git a/.github/actions/github-push-action/start.sh b/.github/actions/github-push-action/start.sh
deleted file mode 100755
index 21c3cbe..0000000
--- a/.github/actions/github-push-action/start.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-set -e
-
-INPUT_FORCE=${INPUT_FORCE:-false}
-INPUT_TAGS=${INPUT_TAGS:-false}
-INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'}
-_FORCE_OPTION=''
-REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY}
-
-echo "Push to branch $INPUT_BRANCH";
-[ -z "${INPUT_GITHUB_TOKEN}" ] && {
-    echo 'Missing input "github_token: ${{ secrets.GITHUB_TOKEN }}".';
-    exit 1;
-};
-
-if ${INPUT_FORCE}; then
-    _FORCE_OPTION='--force'
-fi
-
-if ${INPUT_TAGS}; then
-    _TAGS='--tags'
-fi
-
-cd ${INPUT_DIRECTORY}
-
-remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/${REPOSITORY}.git"
-
-git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;
diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml
index 6ef55e5..b81c5e6 100644
--- a/.github/workflows/build_wheels.yml
+++ b/.github/workflows/build_wheels.yml
@@ -256,7 +256,7 @@ jobs:
           echo "Tagging ${BRANCH_NAME}"
           git tag -f nightly-${BRANCH_NAME} HEAD
       - name: Push tags
-        uses: ./.github/actions/github-push-action
+        uses: apache/airflow-github-push-action@b007e7b818e33b04afd056e4c4b57ba917145d7a
         with:
           github_token: ${{ secrets.GITHUB_TOKEN }}
           tags: true