Skip to content

GH Action that pushes JS code to screeps.com

License

Notifications You must be signed in to change notification settings

kskitek/screeps-pusher

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

screeps-pusher

It is a small utility program and GitHub Action to push JavaScript code into Screeps.com.

Inputs

Input Description
branch Required. Destination branch in screeps. Be aware that screeps does not create new branch automatically.
token Required. Screeps API token. Can be obtained from account settings: https://screeps.com/a/#!/account/auth-tokens.
dir Optional. Directory for .js files.
apiURL Optional. Screeps server API URL.
timeout Optional. HTTP Client timeout.

Example

steps:
- name: Checkout
  uses: actions/checkout@master

- name: Push the code
  id: myaction
  uses: kskitek/[email protected]
  with:
    branch: experimental
    token: ${{ secrets.token }}

Full example

steps:
- name: Checkout
  uses: actions/checkout@master

- name: Push the code
  id: myaction
  uses: kskitek/[email protected]
  with:
    branch: experimental
    token: ${{ secrets.token }}
    dir: src/
    apiURL: https://screeps.com/api/user/code
    timeout: 10s

Full workflow example to push on tag/release

.github/workflows/tag.yml

name: Push released code
on: tags
jobs:
  push:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@master

    - name: Push the code
      id: myaction
      uses: kskitek/[email protected]
      with:
        branch: main
        token: ${{ secrets.token }}

Full workflow example to push on PR

.github/workflows/pr.yml

name: Push experimental code
on: pull_request
jobs:
  push:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@master

    - name: Push the code
      id: myaction
      uses: kskitek/[email protected]
      with:
        branch: ${{ github.ref_name }} # be aware that screeps does not create new branch automatically
        token: ${{ secrets.token }}