Git Product home page Git Product logo

javascript-action's Introduction

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 "[email protected]"');
    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/[email protected]
        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

javascript-action's People

Contributors

gayanvoice avatar github-insights-bot avatar upptime-bot avatar

Watchers

 avatar  avatar  avatar

javascript-action's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.