2.0.0 • Published 3 years ago

github-javascript-action v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

JavaScript Action | File Handling and GitHub Operations

Use this repository to bootstrap the creation of a JavaScript action for file handling and Git operations.

This repository includes create directory, create Json file, read Json file, git commit and git push.

Create an action from this repository

1. Folk the repository

2. Change the git.js

Go to src/git/git.js and change user.email with your GitHub account's primary email and user.name with your GitHub profile name.

const {exec} = require('child_process');
const core = require('@actions/core');

async function commit() {
    core.info('git commit');
    exec('git config --global user.email "username@mail.com"');
    exec('git config --global user.name "GitHub Name"');
    exec('git add .');
    exec('git commit -m "message"');
}

module.exports = commit

3. Package for distribution

Run prepare

npm run prepare

4. Push changes to repository

Create a workflow

1. Create an empty repository or go to an existing repository

2. Create YML file in .github/workflows/main.yml and change to your JavaScript Action repository url

name: JavaScript CI
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:
jobs:
  deployment:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2.3.3
        with:
          ref: ${{ github.head_ref }}
          token: ${{ secrets.GITHUB_TOKEN }}
      - name: JavaScript Action
        uses: gayanvoice/javascript-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SECRETS_CONTEXT: ${{ toJson(secrets) }}

3. Go to Actions to see the process

2.0.0

3 years ago

1.1.26

3 years ago

1.1.25

3 years ago

1.1.24

3 years ago

1.1.23

3 years ago

1.1.22

3 years ago

1.1.21

3 years ago

1.1.20

3 years ago

1.1.19

3 years ago

1.1.18

3 years ago

1.1.17

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago