Giter VIP home page Giter VIP logo

changes-since-last-tag's Introduction

typescript-action status

WARNING: The GitHub list tags API was used to fetch the tags. It was assumed they were in chronological order; however, they are actually in alphabetical order. Using regular v.X.X.X versioning still works; however, if they are NOT alphabetical order this will not work as expected. More information can be found about this issue here.

changes-since-last-tag

Do you do deployments when you push a new tag? Do you ever have multiple deployments in single repository? Do some of those deployments take a long time? Could some of these deployments be sometimes skipped if certain files haven't changed? If you answered yes to all of these questions, this action might be for you.

Inputs

NOTE: In addition to the inputs defined below, you can also pass in any of the minimatch options defined here. For example, if you want to see the dot property, set dot: true.

glob

description: The glob(s) of the files to check for changes (uses minimatch). All file changes that don't match at least one of the globs are filtered out. If you want to provide multiple globs, use a , between each glob. Defaults to **.
required: false
example: src/**
example: **
example: *.js,*.py

Outputs

Ensure to set the step ID using the id attribute. See the docs.

steps.<STED_ID>.outputs.files

description: The names of all of the added, modified, removed and renamed files (comma separated).
example: a.txt, src/b.txt

steps.<STED_ID>.outputs.added

description: The names of the newly created files (comma separated).
example: a.txt, src/b.txt

steps.<STED_ID>.outputs.modified

description: The names of the updated files (comma separated).
example: a.txt, src/b.txt

steps.<STED_ID>.outputs.removed

description: The names of the removed files (comma separated).
example: a.txt, src/b.txt

steps.<STED_ID>.outputs.renamed

description: The names of the renamed files (comma separated).
example: a.txt, src/b.txt

steps.<STED_ID>.outputs.any_changed

description: Whether there were any files changes. This will always be false when this action runs on the first tag (as there is nothing to compare this tag to).
example: true

steps.<STED_ID>.outputs.first_tag

description: Whether this is the first tag.
example: false

Example Usage

You have repository that contains both the Android files (android/) and iOS files (ios/). Your GitHub action(s) contain two builds, one for iOS and one for Android. Sometimes, you only need to update your iOS application or vice versa. If one of these situations occur, you want to make sure only the builds that need to run actually do run.

# This is required. This *must* only be run when a tag is pushed.
on:
  push:
    tags:
      # This is a catch all pattern but you can define your own pattern
      - '*'

jobs:
  deployment:
    runs-on: ubuntu-latest
    steps:
      - id: android_changes
        with:
          glob: android/**
        uses: jsmith/[email protected]

      - id: ios_changes
        with:
          glob: ios/**
        uses: jsmith/[email protected]

      # The == 'true' is important since we can only output strings
      # If you forgot this, the build will always run... I think
      - if: steps.android_changes.outputs.any_changed == 'true'
        run: make android # just an example command

      # Same as above except for ios
      - if: steps.ios_changes.outputs.any_changed == 'true'
        run: make ios

# This is an alternative method where this action just once
# This method *could* lead to false positives but it is unlikely
jobs:
  deployment:
    runs-on: ubuntu-latest
    steps:
      - id: changes
        uses: jsmith/changes-since-last-tag@v1

      - if: contains(steps.changes.outputs.files, 'android/')
        run: make android # just an example command

      - if: contains(steps.changes.outputs.files, 'ios/')
        run: make ios

Deployment

These steps detail how to release a new version of @jsmith/changes-since-last-tag.

  1. Make and commit your changes.
  2. Run npm version COMMAND with the appropriate COMMAND.
  3. Push everything using git push && git push --tags.
  4. Publish a new release on github.com.

changes-since-last-tag's People

Contributors

dependabot[bot] avatar jsmith avatar razbensimon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

env0 razbensimon

changes-since-last-tag's Issues

Option to use tag pattern

Would it be easy to add an option to filter checked tags based on a pattern?

Say, I have a project with two packages, site and cms.

They have separates build processes as jobs in a build-and-deploy workflow, and their versions don't necessarily sync as they don't have to be updated together.

So what if I did site releases by using the tag deploy-site-vn.n.n and cms releases using deploy-cms-vn.n.n.

It would be cool if I could pass a tags option to this like deploy-site-v* or deploy-cms-v*, which would let me separate those build processes without the tags interfering with one another.

That way, if I tag a commit deploy-site-v0.0.1 , the next commit deploy-cms-v0.0.3, and finally one more called deploy-site-v0.0.2, the action (when passed deploy-site-v*) will only look for file differences between deploy-site-v0.0.2 and deploy-site-v0.0.1, ignoring deploy-cms-v0.0.3.

Docs is wrong & Missing release tag

Hello,
I start using your GitHub action.
I Had some issues with it, and by debugging I found some of the problems.

  • the docs are wrong
    • v1 tag is not exists
    • any_changes should be any_changed
  • from some reason, 0.3.2 doesn't work. And that is actually the version that GitHub's market tells to install.
    • but uses: jsmith/changes-since-last-tag@main works. Can you release a new tag?

Feature request:

  • support minimatch options object. (e.g { dot: true })

Thanks for your time!

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.